anonymouse
anonymouse

Reputation: 639

Call ajax load from a popup

I'm trying to dynamically load html into a popup using ajax with this:

$('body').load( new_url, function (responseText, textStatus, XMLHttpRequest ) { ... } );

It works fine, but it doesn't load the html into the subwindow, it loads it into the opening window. If I have a reference to the subwindow "win", how can I do something like this:

win.$( 'body' ).load...

currently, that gives an error saying win.$ is not a function.

Thanks!

Upvotes: 1

Views: 348

Answers (2)

Kundan Singh Chouhan
Kundan Singh Chouhan

Reputation: 14282

Try this instead ::

$("body", win.document).load(URL, function() {
    // do your stuff
});

Hope this will help !!

Upvotes: 1

ATOzTOA
ATOzTOA

Reputation: 35940

You should use it like this:

$('body', win.document).load...

Upvotes: 0

Related Questions