I solved the issue thanks to this guide (it's in Italian, use google translated if interested): http://gabrieleromanato.com/2012/02/...emento-iframe/
Anyway I've found a problem, I can't make "getElementById" work on my example (posted below)
Here's the Html code:
Code:
<html>
<head>
<title>Example</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script language="javascript" type="text/javascript" src="basic.js"></script>
</head>
<body>
<p id="test">Example:</p>
<!-- Define a paragraph for result text -->
<p id="result"></p>
</body>
</html>
And here's the Javascript part:
Code:
window.onload = function(){
var paragraph = document.createElement('p');
var xyz = document.getElementById("test");
var string = document.createTextNode(xyz[0]);
paragraph.appendChild(string);
document.getElementById("result").appendChild(paragraph);
}
Everything should be fine but I can't figure out why it doesn't work, since I have <p id="test">Example:</p>
I did the same thing with getElementsByTagName("p") and it worked, but I would like to understand why it doesn't work this way..