I want access to the content of an iFrame, on the same domain. I have a small and easy example but it doesnt' work, I search the problem since too much time :-(
Here is my code :
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<head>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script>
$(document).ready(function(){
alert($('#iframeID').contents().find('#someID').html());
});
</script>
</head>
<body>
<iframe id="iframeID" src="test.html"></iframe>
</body>
</html>
And the frame called :
<div id="someID">Hello world!</div>
Can someone help me please ? Thank you for your help
Mathieu