Jump to content
  • 0

Receiving Parameters In I-Frame From Parent Page


ALittle

Question

I am trying to filter datapages that are embedded within a page that I show within an iframe and I can not seem to get the parameters to pass into the I-Frame when the parent page is loaded. 

 

I have a "Project" report with custom link to details page. This link passes Project_ID fine to datapages actually embedded on the target page. What I want to do is embed other pages (hosted on same domain) via IFrame and have the results of datapages embedded on the page shown in iframe filtered by the Project_ID.

 

I want to use I frames to reduce load time, data usage and also have the ability to refresh specific datapages when editing data.

 

Again, the parent page that hosts the Iframe is receiving the parameter fine, i just can not get the DPs within the embedded page to see the passed parameter.

 

Much help in advance!

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

Hello,

 

Have you tried receiving the parameter into the iframe as well, similar to the following:

 

Assume that the parameter was a query string parameter and the URL is such: http://www.somesite.com/report.html?User_ID=5

 

In the iframe add the parameter similar to the red text:

 

<iframe name="Report" title="Report" src="https://cxxxxxx.caspio.com/dp.asp?AppKey=d667300025da4ecdbaf64b77ae7a&User_ID=[@User_ID]">Sorry, but your browser does not support frames.</iframe>

 

Let me know if this helps at all.

Link to comment
Share on other sites

  • 0

Hi - To pass URL query string parameter to an iFrame, you may do the following:

1. Add an id attribute on your iFrame, like add id="myiframe". The deployment code should be like this:
<iframe name="Some iFrame" title="Some iFrame" src="https://c1234567.caspio.com/dp/xxxxxxxxxxxxxxxxxxx" id="myiframe" >Sorry, but your browser does not support frames. Please, contact us.</iframe>

2. Once the id is added, copy and paste the code below in your webpage:

<script language="javascript">
var iframe = document.getElementById('myiframe');
iframe.src = iframe.src + window.location.search;
</script>

You can change the name of the iframe id depending on your preference.

What that code/script does is get the parameter query string of the current page and add the same query string to the iframe src.

Hope it helps!

Link to comment
Share on other sites

  • 0

Hi @Meekeee,

I was trying to implement this for one of my applications. I have a parameter on my webpage that I need to pass to a series of iframes. 

It seems I am getting not only the parameter value, but also the parameter name. As well as the '?' in the URL for starting parameters.

Is this how it is supposed to work? I might've misunderstood the workflow. But, I am trying to get '202530' into Job, not '?O_Job_Number=202530".

orderparam.thumb.PNG.0e5eb69ac6ac80a08f1cc8aaeb53903f.PNG

Link to comment
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.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   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...