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 data to a html document

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
i have a 'default.htm' this has a frame in it
<iframe src=strFrameDoc>
basicall i want to open this default.htm and have it know what i want to put as the variable strFrameDoc.

I know i can pass an asp page values using a querystring
for instance if the request for the webpage was
c:\default.asp?frameHtmldoc=d:\message123.htm

i could then use Response.QueryString to get the d:\message123.htm

how do i accomplish the same task using client side scripting??? i have tried to user Document.URL but this doesnt give me the stuff after the '?'

any advice would be great
regards,
richard
 
use location.search to get querystring info in javascript...

if the url to your html page is something like

myPage.htm?somePage

then to get 'somePage' in script...
var qry = location.search
var qrytxt = qry.substring(1)

to make this the frame src you can say...

<script language=javscript>
var qry = location.search
var qrytxt = qry.substring(1)
document.write(&quot;<iframe src='&quot;+qrytxt+&quot;.htm'>&quot;);
</script>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top