Thursday, January 9, 2014

Content Editor Web Part


SharePoint 2010 doesn't allow you copying and pasting scripts into the editor. 

In SharePoint 2010,  "Rich Text Editor" and "Source Editor" buttons are no longer available.

First Method:

Edit Page, Insert CEWP on Page

Select CEWP WebPart and focus is on webpart area

Go to Ribbon, Click  on HTML -> “Edit HTML source” menu item

Now, Editor will be opened.

Add the sample javascript

<script language ="javascript">
alert("Hi");
</script>

Click on Ok to see the result on the Page

Second Method:

Add all your scripts inside a txt file stored in SharePoint site and then pointing the CEWP to use that file as the source.

First, create a file with all of your code (both Javascript and HTML - basically everything you would have normally pasted into the content editor.) 

Use  <script type="text/javascript"> tag in beginning and save the file with a .txt extension

Next, add a CEWP to your page and select "Edit Web Part." 

In the content editor pane on the right, under "Content Link", add the URL to your txt file and click "Apply" 

See the Action.


1 comment:

  1. Automated Forex Trading :roboforex login Is An Automated Forex Investing Software. It Is An Algorithmic Trading Software That Provides Automated Forex Trading Signals.

    ReplyDelete