问题描述:

In header.php file , below is used

<script type="text/javascript" src="http://example.com/library/includes/jQuery142.js">

</script> // jquery

<script type="text/javascript" src="http://example.com/library/includes/jqueryautoiframe.js">

</script> // plugin iFrame Sizing

in view file below code, How do i put below in to zend ?I used below code but not working.

<iframe src="blabla"></iframe>

<script>

$('iframe').iframeAutoHeight(); //iframeAutoHeight is the function in jqueryautoiframe.js

</script>

网友答案:

You need to wait until the document is ready before you can use any js

try this:

<script>
$(function() { 
     $('iframe').iframeAutoHeight(); //iframeAutoHeight is the function in jqueryautoiframe.js
});
</script>
网友答案:

try

<iframe src="http://google.com"></iframe>
<script type="text/javascript">
$('iframe').iframeAutoHeight(); //iframeAutoHeight is the function in jqueryautoiframe.js
</script>

Your iframe source is 'blabla' did you put it intentionally ??

网友答案:

try

<?php
$this->headScript()
->appendScript(
    <<<'BODY'
    $('iframe').iframeAutoHeight();
    });
BODY
);
?>
相关阅读:
Top