0

How can I access parameters passed from iframe src in Visualforce page. Lightning Page Iframe:

<iframe src="{!v.VFUrl}" width="100%"  height="500px;"  frameBorder="0"/

In VF page trying to access like:

 Visualforce.remoting.Manager.invokeAction(        
    
'{!$RemoteAction.GPD_StakeholderSchedulerPageController.getStakeholder}',
    '{!$CurrentPage.parameters.projectId}',
         function(results, event){...
}

But unable to access, is there anything i'm wrongdoing. Can anyone help me out please.

1 Answer 1

0

There are two options of passing iframe params.

First Options :

Add your params as a query param to the iframe url (v.VFUrl}). iframeURL.page?accountId=6573498576453&secondParam=4566456

Then from VFPage you can access.

var url = new URL(window.localtion.href);
var c = url.searchParams.get("accountId");
var d = url.searchParams.get("secondParam");

Second Option:

Use window.postMessage from lightning component.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .