Hi there,

When I put the following code on my page.

<script type="text/javascript" src="../../Scripts/jquery-1.4.1.js" />

Then anything below will became nothing, can anyone tell me why?

Thanks alot.

Sorry, I am very new in web development.


+2  A: 

The first thing to check is that the path to the script file is valid and the file exists.

I'm assuming the latter, but as you are specifying a relative path to the scripts folder, make sure that it resolves to the correct location.

Without seeing your directory structure I can't say more.

+1  A: 

Use an absolute href for the script rather than a relative href. ASP.Net can be ... picky about href's that go above the level of the VD, and I bet that's what's happening here.

Joel Coehoorn
+1  A: 

Is that relative src path visible from your page? I'm thinking it's not.

Ed B
+1  A: 

We need more information to fully answer your question.


1.) The script is within the block.

2.) Your document is well-formed (validates) and has a document type definition.

3.) The script exists.

If still no luck, post back with the entire contents of your xHTML document and the browser in which the problem occurs.

Martin Eve
+18  A: 

Script tags are not allowed to be auto closed:

<script type="text/javascript" src="../../Scripts/jquery-1.4.1.js" ></script>
+1 for first correct answer!
Andy E
+1 Just about to write that. But can you tell me why?
Beat me by 26 seconds..
_.... plus one for pointing it correctly...
+3  A: 

You cannot close the tag with />. You must do the following:

<script type="text/javascript" src="../../Scripts/jquery-1.4.1.js"></script>
+1  A: 

I can guess. You have to close your script file using </script> not simple <script .. /> Try like this. Otherwise some other code base might cause the same problem.