M
mkhines
I'm having trouble figuring out the proper way to pass this variable
in with javascript alone. I'm not used to not being able to use jsp
and all the love that is in that.
Obviously I know little about javascript!
So you get the whole story, the user will begin on a page which has an
iframe in it that picks up a parameter
http://wildlifedisease.nbii.gov/ecoregions/theirpage.html
which contains an iframe that passes a parameter when the form is
submitted to ANOTHER page with an iframe which needs to pick up that
parameter.
So, for example, if you put in 11211 in the text box on the first
page, and submit it, it opens a new window and pushes over the zipcode
parameter value to that next page
http://wildlifedisease.nbii.gov/ecoregions/bigpage.html?zipcode=11211
what i need to do now, is get the iframe in bigpage.html to pick up
that zipcode parameter.
i'm using a substring function (here's the code for bigpage.html) to
get the zipcode value
<html>
<body>
<script type="text/javascript">
var zipcode2=window.location.search.substring(9);
alert(zipcode2);
</script>
<iframe frameborder="0" height="100%" width="100%"
src="http://wildlifedisease.nbii.gov/ecoregions/index.jsp?zipcode=
+zipcode2.value+"></iframe>
</body>
</html>
which works fine, but I can't figure out how to properly write the
src="" part.. i've tried every combination of apostrophes and plus
signs, argh!
help?
Thanks!!!!
in with javascript alone. I'm not used to not being able to use jsp
and all the love that is in that.
Obviously I know little about javascript!
So you get the whole story, the user will begin on a page which has an
iframe in it that picks up a parameter
http://wildlifedisease.nbii.gov/ecoregions/theirpage.html
which contains an iframe that passes a parameter when the form is
submitted to ANOTHER page with an iframe which needs to pick up that
parameter.
So, for example, if you put in 11211 in the text box on the first
page, and submit it, it opens a new window and pushes over the zipcode
parameter value to that next page
http://wildlifedisease.nbii.gov/ecoregions/bigpage.html?zipcode=11211
what i need to do now, is get the iframe in bigpage.html to pick up
that zipcode parameter.
i'm using a substring function (here's the code for bigpage.html) to
get the zipcode value
<html>
<body>
<script type="text/javascript">
var zipcode2=window.location.search.substring(9);
alert(zipcode2);
</script>
<iframe frameborder="0" height="100%" width="100%"
src="http://wildlifedisease.nbii.gov/ecoregions/index.jsp?zipcode=
+zipcode2.value+"></iframe>
</body>
</html>
which works fine, but I can't figure out how to properly write the
src="" part.. i've tried every combination of apostrophes and plus
signs, argh!
help?
Thanks!!!!