dx_over_dt
dx_over_dt

Reputation: 14318

Get reference to jQuery from jQuery object

I'm writing some tests for an ASP.Net page with UpdatePanel postbacks. I run the tests from one page (the outer page), and load the page being tested into an iFrame. Then the outer page gets a reference to the tested page's jQuery object on load.

I have a hunch that after an async postback, something funky is happening and the test page's jQuery object is being overwritten, but my outer page's reference to it is not being updated (or vice versa--not sure yet).

I have a reference to a jQuery-wrapped DOM element in the test page. How do I get a reference to the jQuery object used to wrap it so that I can compare it to the jQuery reference my outer page knows about?

EDIT

What I mean is this:

var x = $(foo);
if (someFunc(x) == $) {
    // success!
}

I need to define someFunc().

Upvotes: 1

Views: 45

Answers (1)

Felix Kling
Felix Kling

Reputation: 816442

The jQuery object's constructor property points back to jQuery:

> jQuery().constructor === jQuery
true

Upvotes: 2

Related Questions