views:

114

answers:

7

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.

Thanks

+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.

ChrisF
+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.

Check:

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>
Terry
+1 for first correct answer!
Andy E
+1 Just about to write that. But can you tell me why?
MvanGeest
Beat me by 26 seconds..
GenericTypeTea
_.... plus one for pointing it correctly...
Reigel
+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>
GenericTypeTea
+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.

Multiplexer