Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How To Run Javascript on Another Website

Status
Not open for further replies.

Ferty

Programmer
Oct 19, 2007
2
US
I am an amateur at Programming and Web Design, and my knowledge is limited.

I am trying to modify a form data on a website I link to (just put values in their forms). I'm quite sure my code is right, because I can inject it in the address bar and it works.

So here's what doesn't work:

window.location=...
window.onload=doStuff;
function doStuff() {
//modify form data....
}

How can I get this to work, because the Javascript is not waiting for the page to load?
 
Hi

The entire object tree built when rendering a document is disposed when the page is unloaded. The JavaScript of one document does not survive after the document itself is removed from the memory.

What you try may work if both documents are alive in different windows/tabs or frames. Of course, the browsers will not allow script loaded from on domain to modify a document loaded from a different domain.

Feherke.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top