TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   Javascript, AJAX, E4X (http://www.talkphp.com/javascript-ajax-e4x/)
-   -   Expected an assignment or function call and instead saw an expression? (http://www.talkphp.com/javascript-ajax-e4x/2438-expected-assignment-function-call-instead-saw-expression.html)

Haris 03-08-2008 01:26 PM

Expected an assignment or function call and instead saw an expression?
 
Problem at line 12 character 12: Expected an assignment or function call and instead saw an expression.

this.todo;

Strange. Why does jslint.com errors out?

Code:

jQuery(document).ready(function() {
  /**
  * sliceDo iterates slice array, evalutes the toDo array as javascript under click event for each slice based on slice index.
  * @param array slice
  * @param array toDo
  */
  sliceDo = function(slice) {
    jQuery.each(slice, function(index, value) {
      jQuery(value).click(function(){
        return false;
      });
      this.todo;
    });
  };

  // Array of slices of Pie Menu
  slice = jQuery('#pie').children();

  // Work to be done by the slices
  var work = {
    todo: jQuery(slice[1]).mouseover(function(object) {
      menuOffset = jQuery('.pie_menu').offset();
      jQuery('#pie_right').show().css({top: menuOffset.top + 50 + 'px', left: menuOffset.left + 140 + 'px'});
    }).mouseout(function() {
      jQuery('#pie_right').hide();
    })
  };

  sliceDo.apply(work, [slice]);

  jQuery('.search-results > li').children().click(function(object){
    jQuery('.pie_menu').show().css({left: object.pageX + "px", top: object.pageY-10 + "px"});
    return false;
  });
});


Salathe 03-08-2008 03:09 PM

The line this.todo; is pointless, it does nothing what so ever, which is why JSLint is complaining. What were you trying to achieve by using this line?


All times are GMT. The time now is 03:40 AM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0