Reputation: 6789
I'm developing a jQuery mobile application. The application is developed in JavaScript, jQuery, and HTML. When I debug the application in browser using Firebug (in Firefox) it's working fine, but it doesn't run normally? Is there a reason it's running in debug mode only?
Upvotes: 0
Views: 132
Reputation: 20371
Your question is worded somewhat confusingly so I'm not quite sure what you mean but I think you might be running into a problem with console.XXX()
statements in your JS - on a browser that doesn't have console
defined (like IE) or a Firefox installation that doesn't have Firebug, console
will be undefined and your JavaScript code is likely to fail if you have forgotten to comment out your logging statements. You can verify if that is the problem by commenting out all calls to console
(or by watching the console and looking for log output).
A long term solution might be to define the console object when your JavaScript initially loads if it finds that the console
doesn't exist - this way, even if you forget to comment out calls to console
and someone who doesn't have Firebug installed or is using a different browser tries to use your code, they won't run into this issue. Take a look at this blog post
Upvotes: 4