开发者

JavaScript not loading after output of PHP file_get_contents() string

开发者 https://www.devze.com 2023-01-01 14:19 出处:网络
I have the following structure: -uploadpage.html -index.php -resources -jquery-1.4.2.min.js On my index.php, I get the contents then output uploadpage.html through this code:

I have the following structure:

-uploadpage.html
-index.php
-resources
    -jquery-1.4.2.min.js

On my index.php, I get the contents then output uploadpage.html through this code:

$output = file_get_contents("uploadpage.html");
echo $output;

My upload.html has the javascript at the bottom:

<script type="text/javscript" src="./resources/jquery-1.4.2.min.js"></script>
<script type="text/javascript">
 $(document).read开发者_如何学Cy(
     function() {
      callSomething();
     }
 );
    function callSomething() {return true;}
</script>

However this results in an error "$ is not defined" which means that the jquery js file is not loaded. Any ideas?


change:

type="text/javscript"

to:

type="text/javascript"


jquery.1.4.2.min.js
jquery-1.4.2.min.js

If that was just a typo in your question, open up Firebug and look at the "Net" tab to see what the browser is actually trying to load, and what happens when it tries to do that.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号