Getting Object Expected errors trying to use jQuery

I am trying to take the following very simple page and make it work in a visual studio project. I either get a "Javascript Runtime Error: Object Expected" or a "$ is not a recognized command" I have made sure the library file is where it is supposed to be. Any clues as to why I am not having any luck with this?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<html>                                                                  
 <head>                                                                  
 <script type="text/javascript" src="../jquery-1.2.6.js"></script>          
 <script type="text/javascript">
     // we will add our javascript code here         
     $(document).ready(function() {
         // do stuff when DOM is ready
     });                                 
 </script>                                                               
 </head>                                                                 
 <body>  
 
                                                                
   <!-- we will add our HTML content here -->                                        
 </body>                                                                 
 </html>

Open in new window

SGyvesAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Michel PlungjanConnect With a Mentor IT ExpertCommented:
a) your JS is not where the BROWSER thinks it is
b) the js file is corrupt
c) the browser does not think it is javascript (server serves it with the wrong mime type)

I think a)

Try Firefox 3.03 and look in the JS console
0
 
SGyvesAuthor Commented:
The answer is 'a'. The designer seemed to think it could fins the js file with the src specified as "../jquery-1.2.6.js" however...at runtime...it could not. When I dragged the js file into the page head..it made its own entry and it was "jquery-1.2.6.js"   Made all the difference in the world. Not before nearly driving me crazy. Because if you are flat out wrong with the location of the file...before you even run the page...the intellisense is telling you that it cannot find the file. Both of these formats were okay with intellisense, but only the latter ran.
0
 
SGyvesAuthor Commented:
Have some points.
0
 
Michel PlungjanIT ExpertCommented:
:) Great
0
All Courses

From novice to tech pro — start learning today.