javascript not loading after output of PHP file_get_contents() string

Posted by mives on Stack Overflow See other posts from Stack Overflow or by mives
Published on 2010-06-01T14:29:12Z Indexed on 2010/06/01 14:33 UTC
Read the original article Hit count: 170

Filed under:
|

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).ready(
     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?

© Stack Overflow or respective owner

Related posts about php

Related posts about JavaScript