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!

passing a querystring to a NS6 iframe 1

Status
Not open for further replies.

crazyboybert

Programmer
Jun 27, 2001
798
GB
Hmmm. This is starting to really bug me so i am hoping someone will have come across it before and found a workaround or at least will be able to put my mind at ease and confirm that the wonderous Netscape 6 browser in all its standards compliant glory is as poor as i think!! Right thats the rant over thankyou for listening - just need to get it off my chest!

Im trying to pass a querystring to an iframe. The reasoning is that i need to know screen width inside an iframe but Javascript wont let me test for this as the iframe doesnt 'own' the window. So i thought OK ill get the screensize in the top level document and then pass it to the iframe using a querystring written with a javascript document.write.

sounds good yeah! all is well in IE and then i think ohh i better test in NS6 for that small proportion of disillusioned souls out there determined to make my life awkward - sorry i digress yet again - and disaster. absolutely nothing. It appears that netscape refuses to pass the querystring to the iframe. In fact even hard coded into the iframe src like this
Code:
<iframe src=&quot;mypage.asp?w=1000&quot;>
it still doesnt get passed. Seems like NS6 just drops the querystring from the end of the url and doesnt pass to the server.

Anyone else experienced this or can think of another way top get the screenwidth into the iframe?

cheers for any ideas and sorry for the rant just had enough of cross browser compatability today!!


rob
#-)
 
You could get the iframe page to call a function in the parent that returns the screen width. I know this works in IE but I haven't tried it in NS6.

The function call would be something like:

myVar=parent.getIframeWidth();

Good luck! ASCII silly question, get a silly ANSI
 
THANK YOU!!

That works a dream.

Cheers modalman.

A well deserved star!!

s-)
 
I think you may be able to help me on a similar problem. I am trying to send a form to an iframe in IE5. I set the target in my form to the iframe name but when the form is sent it always opens a new window suggesting that the target name is not recognised. Do you know if it is possible to post a form to an iframe or am I flogging a dead horse. Thanks in advance. ASCII silly question, get a silly ANSI
 
Hi Modalman.

The answer is yes you can post to an iframe. I just tried a test page and got it to work in IE6, IE5.5 and NS6. I havent tested any earlier versions of IE and NS4 doesnt support iframes so it is irrelevant there unless you want to mess around with ilayers as well (urghhh!).

Heres the code i used for the form page:
Code:
<html>
<head>
<title>Iframe test</title>
</head>

<body>
<form name=&quot;tester&quot; action=&quot;testiframe.asp&quot; target=&quot;testiframe&quot; method=&quot;post&quot;>
<input type=&quot;text&quot; name=&quot;testname&quot; id=&quot;testname&quot; size=&quot;50&quot;>
<input type=&quot;submit&quot; value=&quot;go on&quot;>
</form>

<iframe src=&quot;testiframe.asp&quot; name=&quot;testiframe&quot; width=&quot;100%&quot; height=&quot;500&quot; border=&quot;1&quot;></iframe>
</body>
</html>

In the page testiframe.asp i just requested the value and pumped it out! wirked ok for me in both browsers without refreshing the form page.

What browser you using? It may be that it is recent support for this?

Anyway hope this helps you in return and cheers again for the quick response yesterday.

Rob

:)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top