Is it possible to use <iframe src="www.google.com"></iframe> to show webpage images in an arcgis online popup?
Brandon
Solved! Go to Solution.
Hi Robert,
Do you also know if esri popups are only associated with layers or could one be created from a button onclick with custom contents?
something like:
var downloadbutton = document.getElementById('Download');
$(function() {
$("#esripopup").dialog({
autoOpen: false
});
$("#Download").on("click", function() {
$("#popup").dialog("open");
});
});
Brandon
Brandon,
You can use a pop up for anything you want (just know that the map can only have one pop up showing at a time). From what ever your code is or called from, just do map.infoWindow.show.
Hi Robert,
I still have not been able to get the iframe to show via an esri popup. This what I have so far:
var downloadBtn1 = dom.byId("Download");
on(downloadBtn1, "click", function (event) {
app.map.infoWindow.setTitle("Download");
app.map.infoWindow.setContent(
<iframe width="600" height="490" src="https://egis3.lacounty.gov/dataportal/2013/11/07/los-angeles-county-sanitary-sewers)" style="margin-left: -268px; margin-top: -326px;"></iframe>
);
app.map.infoWindow.show();
}
});
Does this look right at a glance?
Or is an infotemplate/popuptemplate more appropriate?
You should give the show method a map point to set where the pop up is tied to. Also I have not checked but does your web page you are attempting to open in the iFrame have an x-frame-options in the header response like your Google of x-frame-options should have told you about?
I don't think so. I right clicked on the header and went to inspect. Then I went to console where it said top and couldn't find any x frame option.
Brandon
Which is not good...
You are just not going to get this to work without using the same origin the app has to be the same beginning url as the iFrame. I.e. I can get http://gislap183/js/popupiframe.html to work with a iframe in the popup that has http://gislap183/js/gotoxy_sample.html
I see. But shouldn't I still see the popup container?
I am not sure with those margins you have set in the iFrame.