INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

tracking down cause of JQuery errors

tracking down cause of JQuery errors

(OP)
Hi,

I have an error that occasionally appears in the FireFox error console...

Quote:

TypeError: g.nodeName is undefined jquery-1.7.1.min.js:2

How do I track the actual cause of the error?

Thanks,
1DMF

"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music

RE: tracking down cause of JQuery errors

Find out what object 'g' is a reference to and start there.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum

RE: tracking down cause of JQuery errors

(OP)
How do I go about doing that?

'g' isn't the name of any variable I'm using, where and what do I output to console.log()?

Is there a feature of the console I'm not familiar with that I can use to find this information?

"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music

RE: tracking down cause of JQuery errors

Quote:

'g' isn't the name of any variable I'm using,

Somebody is and if it ain't you ... why does it matter?

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum

RE: tracking down cause of JQuery errors

(OP)

Quote:

Somebody is ...
yes, JQuery I believe. I'm the only one writing JS code here and I have never used a single letter variable in my life other than i,x type loop counter vars.

Quote:

... why does it matter?

because it's an error in the error console. I'm meant to care aren't I?

"In complete darkness we are all the same, it is only our knowledge and wisdom that separates us, don't let your eyes deceive you."

"If a shortcut was meant to be easy, it wouldn't be a shortcut, it would be the way!"
Free Electronic Dance Music

RE: tracking down cause of JQuery errors

Quote:

because it's an error in the error console. I'm meant to care aren't I?
Only if it's your fault.

If the errors are nothing to do with your code, how are you going to fix them if you do find them??

Some could be DOM "fail-over" testing in the library itself. ... Nothing you can do
Some could be the console trying to get browser capability data. ... Nothing you can do.


It's simple. There are two kinds of problem:

Ones you can fix and ones that you can't. So fix the ones you can and stop fretting over the ones you can't.

Obsessing over every little tiny thing is the best way to get a nice new coat ... one with sleeves that tie at the back.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum

RE: tracking down cause of JQuery errors

Quote (ChrisHirst)

Only if it's your fault.

Strongly disagree. Your application, your fault. No matter if the fault is in your code or in an external library. Either you made a mistake programmig or choosing the tools, but it's still your mistake.

This is the main flaw I find in JQuery, that is a nightmare to debug if you have a problem, but even id the error occurs in one of the evily obfuscated piece of code, the actual problem use to be in your own code, as JQuery is widely used and tested.

What I normally do is looking at the stack in the debugger, that usually points to somewhere in your code.

Cheers,
Dian

RE: tracking down cause of JQuery errors

Dian,

Any where, any time ANY application tests for the existence of a function, method, attribute, element name, element ID THERE WILL be an error raised. This is fundamental to ensuring cross browser compatibility and having it so that such 'issues' DO NOT prevent the application from functioning correctly or appropriately under ALL conditions.

Whatever is creating the error IS being handled by the application RATHER than bringing down the browser.

If you open the browser console on ANY page that uses Google Analytics you WILL find error messages as the code inspects the browser capabilities so it can report it accurately. This NOT a problem that YOU can 'fix', it is NOT a problem that Google can 'fix'. It is NOT even a 'problem' it IS simply a function of the code in determining what can be done or how it can be done TO PREVENT ERRORS from occurring!


So, if you want to spend your time worrying about, or trying to fix something that YOU have NO control over and is NOT actually causing a problem, feel free, but please don't expect everybody to do the same.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close