Stoic
Stoic

Reputation: 10754

`$ is not defined` for jQuery

I am using the following code for a php page, while I am receiving this error. Can someone suggest anything?
I am able to view the source for JS files, when I visit them via links in the view-source: in Chrome..
This is a very small page, while the entire content for this page is as below:

<html>
 <head>
  <title>Code Library: Localhost Repository</title>
  <script type="text/javascript" href="js/jquery-1.4.4.min.js"></script>
  <script type="text/javascript" href="js/jquery.uniform.min.js"></script>
  <script type="text/javascript"> 
   $(function(){
    $(function(){ $("select, input:checkbox, input:radio, input:file").uniform(); });
   });
  </script> 
  <link rel="stylesheet" href="css/uniform.default.css" type="text/css" media="screen" charset="utf-8" />
 </head>

 <body>
  <form method="post" action="/index.php" class="jqtransform">
   <table>
    <tr>
     <td><label for="title">Code::Title</label></td>
     <td><input type="text" name="title" /></td>
    </tr>
   </table>   
   <input type="hidden" name="CodeSubmitted" value="Y"/>
   <input type="submit" value="Add Code Snippet"/>
  </form>
 </body>
</html>

Upvotes: 1

Views: 1066

Answers (4)

kobe
kobe

Reputation: 15835

looks like this code is wrong thats why jquery is not loaded and giving error

it should be src instead of href , might be a typo error

<script type="text/javascript" src="js/jquery-1.4.4.min.js"></script>
        <script type="text/javascript" src="js/jquery.uniform.min.js"></script>

one more thing , why did you add function inside a function

$(function(){
                $(function(){ $("select, input:checkbox, input:radio, input:file").uniform(); });
            }

);

Upvotes: 0

Sebastian
Sebastian

Reputation: 440

On the lines 4 and 5 it should be a src-Attribute not a href-Attribute:

<script type="text/javascript" src="js/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="js/jquery.uniform.min.js"></script>

Upvotes: 2

prodigitalson
prodigitalson

Reputation: 60413

In your script tags you need to use src not href.

Upvotes: 1

Pekka
Pekka

Reputation: 449813

You're using href instead of src in the script tags.

Upvotes: 15

Related Questions