Sharepoint 2010 Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint 2010       RSS Feeds

jscript+jQuery won't run

  Date: Feb 20    Category: Sharepoint 2010    Views: 1553

What am I doing wrong?

I put up VERY simple jQuery lib & script onto SP2007 using SPD, and it ran the
first time using XP and IE7.

Now I am using SP2010, OOB, no Designer, and Win 7 + IE9. I tried
1) pasting code below into CEWP in a WPP in a DocLib
2) pasting code below into "site Pages" library new page

In both cases, all I got back was the text below that I pasted in.
My goof has to be simple. At least I expected an error msg regarding the jQ

<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<title>jQuery demo</title>
<a href="http://jquery.com/ ">jQuery</a>
<script src="
alert("As you can see, the link no longer took you to jquery.com");



4 Answers Found

Answer #1    Answered On: Feb 20    

Put the code in a text file, and have the CQWP include the text file.

Answer #2    Answered On: Feb 20    

Is the script checked in? The site pages library has documents checked out by

Answer #3    Answered On: Feb 20    

I will look at the chk/in/out status on Monday at the office.
Deanna: I don't understand what putting the code into a "text" file has to do
with it. CEWPs don't typically take files, just typed in content, pasted in
images, or URLs to pages(files). In any case, I never needed to do this in

Answer #4    Answered On: Feb 20    

In 2010, CQWP DO take text files. And, for security, it strips out JS
(sometimes, inconsistently it seems) pasted in as html.

Add a CQWP.
Click "Edit WebPart"
Put a link to the text file in the content link box.
Don't put anything in the CQWP itself at all. (It only pays attention to
either the content link OR the content in the web part.)

Didn't find what you were looking for? Find more on jscript+jQuery won't run Or get search suggestion and latest updates.