TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 03-08-2008, 01:26 PM   #1 (permalink)
The Frequenter
Prolific Welcomer Upcoming Programmer 
 
Join Date: Sep 2007
Posts: 360
Thanks: 24
Haris is on a distinguished road
Default 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;
  });
});
__________________
Necessity is the mother of invention.

My blog
Haris is offline  
Reply With Quote
Old 03-08-2008, 03:09 PM   #2 (permalink)
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

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?
Salathe is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 07:14 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design