Hello,
I have the following jScript on the onLoad event of a custom entity's form, which is supposed to load a new URL in an IFRAME:
function bingMapsLoader() {
var val_Latitude = Xrm.Page.data.entity.attributes.get("pmdci_latitude").getValue();
var val_Longitude = Xrm.Page.data.entity.attributes.get("pmdci_longitude").getValue();
if (!val_Latitude && !val_Longitude) { return; }
bingMapURL = 'http://www.bing.com/maps/embed/viewer.aspx?v=3&cp=' + val_Latitude + '~' + val_Longitude + '&lvl=4&w=600&h=400&sty=r&typ=d&pp=&ps=&dir=0&mkt=en-gb&form=BMEMJS';
Xrm.Page.ui.controls.get("IFRAME_bingmap").setSrc(bingMapURL);
Xrm.Page.ui.tabs.get("tab_General").sections.get("sec_BingMap").setVisible(true);
}
As you can see, the code is pretty basic. However, the IFRAME doesn't load the URL in the iFRAME, which continues to be blank (default is 'about:blank'). Yet, the Jscript doesn't return any errors. The code seems to be valid.
In fact, if I change the bingMapUL variable above to something trivial, like 'http://www.bing.com', the iFRAME still doesn't load the URL.
NOTE: I did uncheck the option to restrict cross-frame scripting.
If I add any URL into the iFRAME's default URL, it loads without any issues. The only issue seems to be with a script asking to change the URL.
No problem with my IF statement either. I have tried the setSrc() function plain and simple to point to whatever URL, and still it doesn't seem to work.
What is that I am doing wrong? :(
Thanks in advance for the help.
Regards,
P.