chipsterva69
asked on
Retrieve parent document value from iFrame
Working on a solution for a Sitecore CMS page that includes passing a variable from the parent page to an VBScript ASP page in an iFrame. The code I currently have in the parent page is:
And the code in the receiving iFrame page is:
I know the parent page code works - the document.write shows the correct code.
When I run the code as-is, I get an 'expected ')' message, with the prompt to put it after "#locationID". I have tried adding it there, nesting it another set of parens, changing top.document to parent.document.body. The anticipated value is a GUID.
Any help is greatly appreciated!
<script>
var locationID = '@Model.IgnitionID';
document.write(locationID);
</script>
And the code in the receiving iFrame page is:
<%
Dim barkBark
barkBark = ("#locationID", top.document)
%>
...later in the code...
<p>Location ID: </p>
<%response.Write(barkBark) %>
I know the parent page code works - the document.write shows the correct code.
When I run the code as-is, I get an 'expected ')' message, with the prompt to put it after "#locationID". I have tried adding it there, nesting it another set of parens, changing top.document to parent.document.body. The anticipated value is a GUID.
Any help is greatly appreciated!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
While the original recommended code did not workout, the input offered led to the eventual solution.
ASKER