Access the attributes of a web framework

2

I want to access the attributes that are loaded in a <iframe> , but I get this error:

  

Error: Permission denied to access property

I understand that it is because of the crossing of domains, but I do not know how to solve it with jQuery or Javascript .

I leave the code I am using:

document.getElementById( iUno ).onload = function(){ 
  iframe = window.frames.iUno; 
  iframe.play(); 
}; 
<html> 
  <head> 
    <meta charset="UTF-8"> 
    <title>Dar play a reproductor</title> 
  </head> 
  <body> 
    <iframe id="iUno" name="iUno" src="https://drive.google.com/file/d/0B0..." frameborder="0" allowfullscreen ></iframe>
  </body> 
</html>
    
asked by Jesus David Cleves Martinez 29.01.2017 в 23:36
source

1 answer

0

Here is an example, where you can access iframe from your id

var elementoIframe=document.getElementById("iUno");// aca te faltaba las comillas
console.log(elementoIframe);
<html> 
  <head> 
    <meta charset="UTF-8"> 
    <title>Dar play a reproductor</title> 
  </head> 
  <body> 
    <iframe id="iUno" src="http://www.w3schools.com"></iframe>
  </body> 
</html>
    
answered by 30.01.2017 в 06:19