开发者

`$ 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>开发者_StackOverflow
 </body>
</html>


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


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>


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


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(); });
            }

);

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜