function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

apex:iframe source link problem

I'm trying to use a call to apex:iframe as below (this isn't the exact code but same situation)


<apex:iframe src="{!IFrameLink}" scrolling="false" frameborder="false" width="810" height="620"/>

and here is what my function looks like

    public String getIFrameLink() {
        if (searchString != null)
            return ''+searchString;
            return 'javascript:void();';


When I view source in IE7 the iframe is constructed like

<iframe src=";q=query+string" scrolling="false" frameborder="false" width="810" height="620"/>


This doesn't work because of the &amp; in the link.  Any suggestions on how to resolve this? I'd still like to have a blank iframe if the test value is empty

Richie DRichie D



Perhaps you could use this:



<iframe src="<apex:outputText value="{!IFrameLink}" escape="false"/>" scrolling="false" frameborder="false" width="810" height="620"/>

 Bit of a hack but it might work...





When I'm trying to use the syntax as you specified it's throwing an error saying that :"The value of attribute "src" associated with an element type "iframe" must not contain the '<' character"

Prashant SavanoorPrashant Savanoor
The thread is old but I still have the same issue.

Is there any workaround or option to stop Apex:iFrame from getting the SRC values with &amp;