Diferència entre revisions de la pàgina «Solució exercici accès prohibit»
De wikiserver
(Es crea la pàgina amb «<pre> <iframe src="http://google.com" name="google" style="height:100px"></iframe> <script> document.getElementsByName('google')[0].onload = function() { try { aler…».) |
|||
| Línia 4: | Línia 4: | ||
document.getElementsByName('google')[0].onload = function() { | document.getElementsByName('google')[0].onload = function() { | ||
try { | try { | ||
| − | alert(frames[0].location) | + | alert(frames[0].location.href) |
} catch(e) { | } catch(e) { | ||
alert("Error: "+e) | alert("Error: "+e) | ||
Revisió del 18:32, 17 oct 2013
<iframe src="http://google.com" name="google" style="height:100px"></iframe>
<script>
document.getElementsByName('google')[0].onload = function() {
try {
alert(frames[0].location.href)
} catch(e) {
alert("Error: "+e)
}
}
</script>