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 5983547
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T22:14:48+00:00 2026-05-22T22:14:48+00:00

The following js method does not return, yet firebug reports no exception: function test_contains_doesNotBailWithoutException()

  • 0

The following js method does not return, yet firebug reports no exception:

function test_contains_doesNotBailWithoutException() {
$.contains(document.getElementById('navlinks', undefined));

// This line should be reached, or you should get an exception message in Firebug.
return true;
} 

where navlinks is something that exists on the page, and $ is from jquery 1.5.1. The method exits (throws, I assume) while calling the contains method, in line 4639 of jquery1.5.1:

return !!(a.compareDocumentPosition(b) & 16);

where a is the navlinks div and b is undefined. Shouldn’t firebug report an exception in the console?

To be sure, running the following in the firebug console yields neither an error message nor a return result:

return document.getElementById('navlinks').compareDocumentPosition(undefined);

EDIT: I’m using Firefox 4.0.1 and Firebug 1.7.1.

  • 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-22T22:14:49+00:00Added an answer on May 22, 2026 at 10:14 pm

    Yes, there should be an exception; I certainly get one with either the JavaScript version:

    Error: uncaught exception: [Exception... "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIDOM3Node.compareDocumentPosition]"  nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)"  location: "JS frame :: javascript:alert(document.body.compareDocumentPosition(undefined)) :: <TOP_LEVEL> :: line 1"  data: no]
    

    or the same thing from the jQuery version (which has a bracket in the wrong place in your example… not that it matters since the missing argument will naturally get filled in with undefined anyway):

    Error: uncaught exception: [Exception... "Component returned failure code: 0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIDOM3Node.compareDocumentPosition]"  nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)"  location: "JS frame :: http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js :: <TOP_LEVEL> :: line 16"  data: no]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The following method does not work because the inner block declares a variable of
The following method does not compile. Visual Studio warns An out parameter may not
In Python compiled regex patterns have a findall method that does the following: Return
I have the following extension method (which is invalid and does not compile ATM):
Why does the following method hang? public void pipe(Reader in, Writer out) { CharBuffer
I get the following Error: jquery1.4.2.js Line: 2828 Error: The Object does not support
Say we have the following method: private MyObject foo = new MyObject(); // and
I'm using the following method to send mail from Python using SMTP. Is it
Consider the following method signatures: public fooMethod (Foo[] foos) { /*...*/ } and public
I am using the following method: set_browser_log_level 'off' but my log level continues to

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.