views:

169

answers:

2

This happens about in about 40-60% of loads, both in FF and chrome, though slightly differently. I'm somewhat new to js, and have no clue to why this would happen randomly. Any ideas?

Here's one readout, they vary.. Usually jquery-min and/or jquery ui are listed as culprits..

Uncaught SyntaxError: Unexpected string
:3000/public/javascripts/app.js:34Uncaught TypeError: Object #<an Object> has no method 'draggable'
:3000/public/javascripts/jquery-1.4.2.min.js:143Uncaught TypeError: undefined is not a function
chrome-extension://pgphcomnlaojlmmcjmiddhdapjpbgeoc/mailto.js:55Got message from bg page - https://mail.google.com/mail/?view=cm&amp;fs=1&amp;tf=1
chrome-extension://pgphcomnlaojlmmcjmiddhdapjpbgeoc/mailto.js:24Starting to rewrite mailtos

invalid label
[Break on this error] ing").height(e);c._tent.outerWidth(),h...g;var l=this,j;this.handles.each(funct 

jquery....min.js (line 199)

I'm running node.js, express, jquery, jquery ui and mousewheel.js for jquery. Any idea why the errors keep changing?

A: 

I don't think it's possible to answer this question without seeing your code, almost in it's entirety. Just a thought though, what order have you got your includes in the <head> of your document?

Should be (if just using jQuery, for example)

  • jquery
  • jquery ui
  • other plugins
  • your code

Have you checked whether jQuery and node.js conflict? A good way to approach doing that is to implement functionality from one library first, then start adding functionality / plugins from another library bit by bit - then you'll see where it breaks and can investigate further. But as I said, very difficult to exactly determine the problem without seeing and testing your code.

In relation to

have no clue to why this would happen randomly

well, JS errors, if there's a lot of them and some of them are fundamental (like library conflicts), will look random, because a lot of functions are trying to execute and so the error that your debugging catches may be different each time.

LiverpoolsNumber9
Thanks, I was afraid of that. The load sequence is as you pointed out. Express being build on node and is supposedly includes jquery, having a hard time figuring out if there's a conflict.. Will try to turn things off untill it goes away.. Thanks again!
heorling
%script{ src: '/public/javascripts/jquery-1.4.2.min.js'%script{ src: '/public/javascripts/jquery-ui-1.8.custom.min.js'%script{ src: '/public/javascripts/jquery.mousewheel.min.js' }%script{ src: '/public/javascripts/app.js' }
heorling
No probs. Sorry I couldn't help more!
LiverpoolsNumber9
Downgrading to 1.3.2 fixes this..
heorling
Makes sense. Some 'compatible' libraries and jQuery plugins won't work with the latest version. Glad you found the answer - make sure you tick your answer as the correct one...
LiverpoolsNumber9
A: 

Jquery 1.4.2 and jquery UI 1.8 are not stable releases and this appears to be a bug. The newer versions perform smoother and better but the errors always involved those two libraries. Downgrading removes the issue, but costs performance, not as smooth etc.

heorling