0

I am using an Iframe. I need to pass some variables (a and b) and capture them in the landing page.

Page -1

  <iframe id="trackFrame" width="600" height="500"  src="maps.html?A=1&B=2" frameborder="0"      
   scrolling="no" marginheight="0" marginwidth="0"></iframe>

In the landing page I need to

Landing Page

  <body onload="initialize(passedA, passedB)">

Please help me I m new to presentation development.

Kasun
  • 561
  • 11
  • 22

1 Answers1

0

Try looking at this post here: How can I get query string values in JavaScript?

First you will need to get an array of the parameters passed, which can be done via:

var newArray = window.location.search.substr(1).split('&')

try calling a blank function on pageLoad that then reads this. The array is then created by reading the param string window.location.search.substr(1) and then splits everything into an array seperated by the & field.

So if you had mysite.com/page.html?a=3&b=4 it would create an array with

newArray(0) = "a=3" and newArray(1) = "b=4"

then

var a = newArray(0).substring(2)
var b = newArray(1).substring(2)

the substring(2) will removed the "a=" and "b=" from the parameter and leave you with your end results for the parameters passed.

This should help you start.

Community
  • 1
  • 1
Cyassin
  • 1,437
  • 1
  • 15
  • 31