kaarsenmaker
asked on
javascript window transfer
I have an iframe sitting on a page. when I click on a link I would like the information about the url of the iframe to be passed along with the page info. is there javascript that can accomplish that?
something like this:
function processForm(theForm, theURL, windowName, features) {
var dest = "";
var newURL = theURL;
dest = document.ratesform.destina tion[docum ent.ratesf orm.destin ation.sele ctedIndex] .value;
newURL = theURL + "?destination=" + escape(dest);
window.open(newURL, windowName, features);
return false;
}
something like this:
function processForm(theForm, theURL, windowName, features) {
var dest = "";
var newURL = theURL;
dest = document.ratesform.destina
newURL = theURL + "?destination=" + escape(dest);
window.open(newURL, windowName, features);
return false;
}
ASKER
from outside the iframe I need to get the URL of the iframe and pass it through as a parameter. This example is similar to what I want to but it doesnt show me how to get the url of the contents of the iframe.
To get the URL of the contents of the IFrame just use :
document.all.iframeid.src
for example:
<BODY onload="alert(document.all .moshe.src )">
<IFRAME id="moshe" src="http://www.yahoo.com"></IFRAME>
document.all.iframeid.src
for example:
<BODY onload="alert(document.all
<IFRAME id="moshe" src="http://www.yahoo.com"></IFRAME>
ASKER
this is what I have on my page, it pops up a window on IE both on the MAc and PC, but it will not work on Netscape, why?
<script language="JavaScript">
<!--
function processForm() {
var dest = document.all.causes_iframe .src;
alert(dest);
return false;
}
//-->
</script>
<script language="JavaScript">
<!--
function processForm() {
var dest = document.all.causes_iframe
alert(dest);
return false;
}
//-->
</script>
document.all dosen;t work in NS.
IFRAME also won't work in Netscape.
You should try and use ILAYER instead for NS. But you are getting into a complicated CrossBrowsers issue.
IFRAME also won't work in Netscape.
You should try and use ILAYER instead for NS. But you are getting into a complicated CrossBrowsers issue.
ASKER
iframes work in Netscape 6, this pop up doesnt work in Netscape 6. is there something like document.all that does work in netscape and IE?
Oh ... I thought you were talking about NS4.x.
Please ignore the previous comment.
Anyway , to do this in NS6 try :
document.getElementById("c auses_ifra me").src
Please ignore the previous comment.
Anyway , to do this in NS6 try :
document.getElementById("c
ASKER
that one didnt work either:
<script language="JavaScript">
<!--
function processForm() {
var dest = document.getElementById("c auses_ifra me").src;
alert(dest);
return false;
}
//-->
</script>
<script language="JavaScript">
<!--
function processForm() {
var dest = document.getElementById("c
alert(dest);
return false;
}
//-->
</script>
ASKER
this last solution doesnt work in IE either, the other one worked in IE
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
you the man avner,
I was missing the id tag on the iframe. I am increasing your point total to 400 because you were so patient and you hit the nail right on the head. go ask your boss for a raise cause you are most defintiely on your game today.
I was missing the id tag on the iframe. I am increasing your point total to 400 because you were so patient and you hit the nail right on the head. go ask your boss for a raise cause you are most defintiely on your game today.
ASKER
sorry the module would only allow me to increase to 300
kaarsenmaker ,
Thank you .
This is the kind of comments that inject the fuel to helping other developers.
Always happy to help.
Thank you .
This is the kind of comments that inject the fuel to helping other developers.
Always happy to help.
function processForm(theForm, theURL, windowName, features) {
var dest = "";
var newURL = theURL;
dest = document.ratesform.destina
newURL = theURL + "?destination=" + escape(dest)+"&URL="+theUR
window.open(newURL, windowName, features);
return false;
}
notice the added URL value pair