Jump to content

Recommended Posts

Okay, so I figured out how to pass a variable via a query string to force a child .html file to open in an iframe on a parent page (I posted a question here regarding this a couple of days ago). If the child file is specified in a URL like, www.dg-ad.com/PF-Skinner.html, some script in the child file, PF-Skinner.html, rewrites the URL like this, http://dg-ad.com/index.html?var1=http://dg-ad.com/PF-Skinner.html. Some script in the parent file parses the query string and forces the child file to open in an iframe name=pf_frame on the page. There is a function in this parent script called refreshFrame. It is set to run as an onload event in the body tag, if there it sees the rewritten URL it loads the child just fine. If there is just a basic URL the page works fine, the iframe is empty. Also, I am using SpryURLUtils.js to get a Spry accordion to open the a specific panel using a query string. It works, but only okay, the results are unexpected. The accordion panel contains links that load child .html fragments into an iframe. When I pass the variable panel in query string like this, www.dg-ad.com?panel=1 the panel opens but the iframe displays a page not found error message. Why would just opening the accordion try to open the iframe. If I open the accordion by clicking links on the page this doesn’t happen. Also, strangely, if I specify the panel=0 the first panel does not open, only the values 1,2 and 3 work (there are no values beyond that). Could the function in the onload event called refreshFrame be parsing the variable panel=1, loading it as a fragment in the iframe and then not finding it. In other words could using the function refreshFrame prevent using additional parameters in the query string. Thanks for looking and for any thoughts The code for both the parent and child are attached.index.htmlPF-Skinner.html

Share this post


Link to post
Share on other sites

Add some debugging output statements to figure out what it's doing. Figure out what the delineate function is returning, use alert or console.log to see what the url variable is after the delineate function runs to see where you're telling the frame to go when you pass different querystring parameters. You may want to use the params object to access the querystring parameters instead of the delineate function.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...