You need to sign in to do that
Don't have an account?
Iframe containing a VF page communication with the parent window.
Hi,
I have a VF page as a homepage component specifically so it loads some script each time the user changes page (this used to be done by an S-control but we are moving it over).
My problem is I am no longer able to reference a variable within the iframe from a custom button (using the execute javascript on-click). With the S-control it was simply:
iframe.var
Unfortunately this isn't working for the VF page and iframe - I think it maybe because the script is embedded within the body of the apex page as opposed to in the head - is there a way of making the script in a visualforce page appear in the head?
Thanks
Matt
**SOLUTION**
The <apex:includescript> component moves any scripts (referenced as static resources by setting the value attribute) into the header of the generated HTML.
All Answers
**SOLUTION**
The <apex:includescript> component moves any scripts (referenced as static resources by setting the value attribute) into the header of the generated HTML.
Hi Naishadh,
If you include your javascript as a static resource then you can use the <apex:includescript> component to include it in the header of the visualforce page.
eg.
<apex:includescript value="{!$Resource.myScript}"/>