Use Javascript for iframes list

0

I am using iframes for a portal, I had to use it by calling id to solve a previous problem. The problem now is that I can not create a list of iframes in javascript, I can only create a id with src .

Can anyone help me?

I'm using this way, but I only store this src , I can not store more.

window.onload = function() {
document.getElementById("id_Iframe").src="LINK_IFRAME";
}
    
asked by anonymous 10.02.2016 / 13:12

1 answer

0

I was really silly. It was close to ;; to the next code:

window.onload = function() {
document.getElementById("id_Iframe").src="LINK_IFRAME";;
document.getElementById("id_Iframe2").src="LINK_IFRAME";;
}

Then you can only call by id in html.

Edited:

Much better solution, which solved my problem, and iframe only opens when modal is opened and when it closes modal it downloads src .

   $('#MyModal').on('show.bs.modal', function () {
   $('#MyModal iframe').attr('src','LINK EXTERNO OU INTERNO');
  })
   $('#MyModal').on('hide.bs.modal', function () {
   $('#MyModal iframe').removeAttr('src');
  })

Very good for the website not to get heavy loading the iframes before opening it

    
10.02.2016 / 17:20