Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6600447
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:37:25+00:00 2026-05-25T18:37:25+00:00

I have a Javascript functions which throw exceptions if something goes wrong. I have

  • 0

I have a Javascript functions which throw exceptions if something goes wrong. I have so used to this behavior, that one day it took me more than 20 minutes to find the error in code because the function did not threw exception, it just failed silently.

Try the following code in Firefox with Firebug plug-in.
Create a html page with a function:

function myfunc(key)
{ 
  alert('I started');
  if(!key)
     throw 'myfunc: Invalid arguments';
}

Then create a second html page with code:

<script type="text/javascript">
myfunc(null);
alert('Exception was before me!');
</script> 

and load this second html page from the first page with jQuery $.ajax function.

The code will be executed correctly, but you’ll see no exceptions logged in the Firebug console.

If you run the same function myfunc(null) right on the frst html page, you’ll se iimediately a red line in Firebug saying:

uncaught exception: myfunc: Invalid arguments

But there is nothing logged out if it executed by jQuery (I guess, jQuery uses eval to run
scripts after $.ajax).

Does this mean that jQuery itself catches exceptions and ignores them while evaluating Javascript? Is there any way I can tell jQuery to let my exceptions to go through?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T18:37:26+00:00Added an answer on May 25, 2026 at 6:37 pm

    It seems, this was a bug or a missing feature of jQuery 1.4.
    We upgraded to 1.6 and now exceptions are getting through even when the Javascript code is loaded and evaluated by jQuery $.ajax call.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some javascript which runs a timer that animates something on the website.
I've been writing some jQuery functions that have JavaScript variables and looping, etc inside
I'm using javascript to call functions that have been put into an object like
I have a JavaScript function which is quite long and performs a number of
I have a little javascript function which is attached to an onClick event of
We have a JavaScript function named move which does just windows.location.href = any given
I have a javascript function for checking errors which I am calling on OnClicentClick
I would like a JavaScript function to have optional arguments which I set a
I have the following JavaScript code: Link In which the function makewindows does not
I have the following javascript code, which loads without error, however the update function

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.