0

Have an open ended question. I have a html form which contains multiple iframes with various urls as their sources (src attribute). My question is - 1. are there any risks in general to have iframes in a web page? Like I heard that MS edge doesn't support iframes as such - is that true? 2. What's the best approach( and why?) to replace these iframes considering the urls used as sources are not having their own API to be used?

P.S:- all the urls return html streams which are rendered within these iframes.

Looking for some directions here as I am pretty lost in here. Thanks in advance!

Arka

animark
  • 91
  • 1
  • 2
  • 7

1 Answers1

2

Re: replacing the iframes, you could possibly load the urls via AJAX or script tags or whatever you want and then bind them to divs. That's heavily dependent on what your frames are doing...

Edit: pasted from my comment below, for example, if you wanted to do this with jQuery, just put this script in your page someplace that makes sense:

$.ajax(url).done(function(data) {
    $("#divId").html(data);
});
Dave
  • 900
  • 6
  • 22
  • These iframes are used only to load html data from other sources. – animark Mar 30 '17 at 04:26
  • Great, then just do something like (jQuery): $.ajax(url).done(function(data) { $("#divId").html(data); }); – Dave Mar 30 '17 at 18:04
  • Thanks for the response.. One question, will this work if 'data' itself contains a whole html document starting with tags? Just being curious.. Will check myself in sometime though – animark Mar 30 '17 at 18:22
  • In that case you probably need to adapt something similar to what's being suggested here: http://stackoverflow.com/a/32671301/1440122 – Dave Mar 30 '17 at 18:29