Abhishek Shukla
Abhishek Shukla

Reputation: 666

How to Update the values using jquery?

How to update the values for popup page to landing page using jQuery.
Ex i have asp page, from this page one another page pops up using having n number of fields
i want to update values from popup page to landing page without doing post back.
please suggest.
Thanks.

Upvotes: 1

Views: 107

Answers (1)

user166390
user166390

Reputation:

The parent's Window object can be accessed from the popup if on the same domain by using window.parent.window.

Then jQuery can be used while specifying a custom Document (the Parent window's Document in this case) as the context, e.g.:

var parentDocument = window.parent.window.document
jQuery(selector, parentDocument).blah(..)

Where blah(..) represents the normal stuff to do. Be very careful when using closures this way - or, better, don't - and test in IE, which loves to partially destroy window contexts. Similarly, a function defined upon the parent's Window object could also be invoked.

There may be nicer approaches with Web Workers, but I do not use them and they are HMTL5'ish only.

Happy coding!

Upvotes: 2

Related Questions