![]() |
change an elements properties in window.open
hey, is there any way i can change an elements properties in window open?
i click a link and it opens a window with window.open, and i want to take something from the current page and place it inside a textarea within the opened window.. is it possible? |
it depends greatly on whose page it is. If it's your page that you are opening then all you have to do is open the window with a query string, parse that out as it opens and add the string to the text box.
If it's somebody else's page you are opening it gets a little tricky - you have to know if the page accepts query strings and how it processes them. Here's how to open a window searching for "horse meat" in google, for example: Code:
window.open('http://www.google.com/search?q=horse meat') |
If the page is on the same domain then you can just reference the other window by the name you assigned what the window.open returned to.
If it is on a different domain but you have access to add JavaScript to both then you can use postMessage() to pass information between them. If it is on a different domain where you don't have access to the JavaScript there then you have no access to do anything with it unless the owner of the page builds in appropriate JavaScript to allow the interaction. |
| All times are GMT +1. The time now is 11:08 PM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.