I have this JS / PHP Code:
<iframe src="" id="contacts_iframe" width="100%" height="300px" scrolling="no" frameborder="0"></iframe>
<script>
function() {
$('#contacts_iframe').load(function() {
if($.trim($(this).contents().find("body").html()) == "") {
alert("empty");
<?php echo $ContactsDisplay; ?>
}
});
});
</script>
I want to be able to echo the $ContactsDisplay
variable if the iframe is empty
I added the alert in to test, but the alert does not show and neither does the PHP variable.
What could be going wrong?