change colour of another page
Using java script is it possible to change the background color of another page, ie if i say i want the background colour to be blue, i would type it into a text box on one page, and when i click the link to the page i want the background color to be blue, its blue. If this i开发者_开发技巧s possible how would i go about it???
If both pages are in (i)frames or one page is in an iframe of the other it is possible using cross-frame scripting. It is also possible if one of the pages is a popup produced by the other.
If not then it is only possible by making a whole bunch of server script and using forms and automatic refreshes or AJAX, not soemthing easily explained.
No, you won't know exactly when that other page has completed loading, if you do, then you can simply get the document.body of that other page and change the background-color style (as long as the other page is not in a different domain and the user doesn't quickly close the page where the link is).
精彩评论