PlayKid
PlayKid

Reputation: 871

Putting Javascript source, then immediately the page not working

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

Upvotes: 7

Views: 281

Answers (7)

Puru
Puru

Reputation: 9113

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.

Upvotes: 1

djdd87
djdd87

Reputation: 68506

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

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

Upvotes: 4

VoltaicShock
VoltaicShock

Reputation: 842

Script tags are not allowed to be auto closed:

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

Upvotes: 18

Martin Eve
Martin Eve

Reputation: 2751

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.

Upvotes: 1

Ed B
Ed B

Reputation: 6054

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

Upvotes: 1

Joel Coehoorn
Joel Coehoorn

Reputation: 416053

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.

Upvotes: 1

ChrisF
ChrisF

Reputation: 137178

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.

Upvotes: 2

Related Questions