Content Editor Web Parts strips out JavaScript RRS feed

  • Question

  • Hi, again me...still moving from 2007 to 2010.

    Today, I am working ona site with a Content Manager Web Part. The contents deal with Google's map API. Again, alll working in 2007, in 2010 not so much. After I paste my html source into the CEWP I am notifed that "The HTML source I entered might have been modifed". I check, and yes, all my JavsScript function calls from HTML were removed...so like, onload="tothis()" bla bla bla.

    Any ideas, thoughts?



    Kemal Tolga Koseoglu Application Developer WATG
    Friday, April 23, 2010 5:07 PM


  • Hi Kermal,

    Yes, you're right - it will strip out certian tags. One way suggested to force javascript in via a CEWP is to save the javascript to a plain text file and save it into a document library. Then point the CEWP source to the url of the uploaded file.

    Alternatively, you could use an XSLT to insert google maps onto the page. I blogged about it here: http://blogs.bsg.co.uk/SharePoint/Lists/Posts/Post.aspx?ID=21

    I hope this helps.

    Brian C | Blog Site
    Saturday, April 24, 2010 7:46 AM

All replies