hadschibradschi
04-23-2003, 02:56 PM
I would like to have a frame with buttons on the left that control the frames on the right on my personal homepage. But they should do slightly more than just load an external page:
For instance they should fill out input fields or "click" buttons for me.
I have adopted a script from javascript.internet.com, which works fine if the to-be-controlled page is from myself.
As soon as I direct it to another page (in this case I would like to fill my username into Yahoo's pages) I get an "Access denied" message.
I played with the security settings of my browser but everythings seems to be ok/allowed there.
Is this a Javascript limitation?
Is this the proper way to accomplish this?
Here's the source of the controlling frame:
<html>
<head>
<frameset cols="200,*" frameborder=1>
<frame name="left" src="leftFrame.html">
<frameset rows="100,*" frameborder=1>
<frame name="upper" src="upperFrame.html">
<frame name="lower" src="http://mail.yahoo.com">
</frameset>
</head>
</html>
Here is "leftFrame.html" who does the work:
<html>
<head>
<script>
function fillUpper() {
top.frames['upper'].document.yourform.msg.value = "myUserName";
}
function fillLower() {
top.frames['lower'].document.login_form.login.value = "myUserName";
}
</script>
</head>
<body>
<center>
<p><input type=button value="Fill upper frame" onClick="fillUpper();"></p>
<input type=button value="Fill Yahoo frame" onClick="fillLower();">
</center>
</body>
</html>
And here's the code for "upperframe.html", where everything works properly:
<html>
<body>
<form name=yourform>
<input type=text name=msg size=10 value="">
</form>
</body>
</html>
The names of the form (login_form) and input (login)
I retrieved directly from Yahoo's site (https://mail.yahoo.com) by scanning the source HTML.
Hope someone can help me (and it's not just a silly typing error of mine).
Many thanks in advance!
For instance they should fill out input fields or "click" buttons for me.
I have adopted a script from javascript.internet.com, which works fine if the to-be-controlled page is from myself.
As soon as I direct it to another page (in this case I would like to fill my username into Yahoo's pages) I get an "Access denied" message.
I played with the security settings of my browser but everythings seems to be ok/allowed there.
Is this a Javascript limitation?
Is this the proper way to accomplish this?
Here's the source of the controlling frame:
<html>
<head>
<frameset cols="200,*" frameborder=1>
<frame name="left" src="leftFrame.html">
<frameset rows="100,*" frameborder=1>
<frame name="upper" src="upperFrame.html">
<frame name="lower" src="http://mail.yahoo.com">
</frameset>
</head>
</html>
Here is "leftFrame.html" who does the work:
<html>
<head>
<script>
function fillUpper() {
top.frames['upper'].document.yourform.msg.value = "myUserName";
}
function fillLower() {
top.frames['lower'].document.login_form.login.value = "myUserName";
}
</script>
</head>
<body>
<center>
<p><input type=button value="Fill upper frame" onClick="fillUpper();"></p>
<input type=button value="Fill Yahoo frame" onClick="fillLower();">
</center>
</body>
</html>
And here's the code for "upperframe.html", where everything works properly:
<html>
<body>
<form name=yourform>
<input type=text name=msg size=10 value="">
</form>
</body>
</html>
The names of the form (login_form) and input (login)
I retrieved directly from Yahoo's site (https://mail.yahoo.com) by scanning the source HTML.
Hope someone can help me (and it's not just a silly typing error of mine).
Many thanks in advance!