I’m building a little upload script. My form has a target to an iFrame and the iFrame locates on the same page as the form.
In the code of the iFrame I upload the files to my server. If the upload is finished i want to run a little jQuery inside the iFrame to hide a div on the parent page (where the form is located).
Strange thing is that the jQuery inside the iFrame doesnt work. If I try a simple
alert(‘bla bla bla’); it doesnt show.
Somebody now what i should do?
Thanks in advance!
the code of the iFrame:
<? if(isset($_POST['Q'])) { echo 'form is set';
echo $_POST['Q']; ?>
<script type="text/javascript" charset="utf-8">
// JavaScript Document
$(document).ready(function()
{
$('#test').show();
});
</script><? } ?><div id="test" style="display:none;">bla bla bla</div>
If you are using jquery withing iFrame you need to have references to JQuery libraries withing the Iframe itself.