how do you write something to someone elses page and submit withjavascript?

N

Newbie

how do you write something to someone elses page and submit with
javascript? I am trying to auto login to a user account as the page is
loaded.
 
J

Joshua Cranmer

Newbie said:
how do you write something to someone elses page and submit with
javascript? I am trying to auto login to a user account as the page is
loaded.

First off, Java != JavaScript. The two are as different as French and
Spanish.

In any case, the answer is "you don't do it." HTML forms (especially
login pages) tend to be posted using the HTTP POST. In the specific case
of logins, the typical sequence of events involves saving a cookie to
the local user's computer. The only way in JavaScript to be able to
manipulate other pages would be via frames (specifically iframe) or
XMLHttpRequest (XHR, for short).

That said, in most if not all modern browsers, cross-domain JavaScript
access to pages is severely restricted due to the numerous security
vulnerabilities that it opens up--the so-called XSS (cross-site
scripting) vulnerabilities. Recently, a specification came out that
would allow sites to explicitly state who may load them via this
mechanisms, the Access-Control headers.
 
A

Arne Vajhøj

Newbie said:
how do you write something to someone elses page and submit with
javascript? I am trying to auto login to a user account as the page is
loaded.

Not possible.

The Google term is:
javascript same origin policy

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top