This project is read-only.

Sterling International Consulting Group

HTML JavaScript Render Web Part

Purpose

The HTML JavaScript Render Web Part is used for displaying raw HTML or executing JavaScript on a SharePoint page. Using the code or script stored in a file within the site, it will render the code on the page. This far superior to using the Content Editor Web Part since the original coding is never affected by the part. Example uses include custom CSS, JavaScript functions, flat HTML content, etc.

Web Part Properties 

This web part has only a few settings:

File Settings

  • Full or Relative URL to the site – this is the URL to the web site that will be storing the HTML or Script file to render.
  • Library Name – name of the library where the file is stored (this is the display name).
  • File Name to Render – name of the file (in the library), i.e. “HideLeftNav.js”.

Display Settings

  • Do not use IFRAME – this applies to rendering HTML code files; if selected, the part will attempt to render the HTML ‘as is’ (in-line code). If not, it will attempt to render the file within an IFrame.
  • Frame Pixel Width – the width (in pixels) to display if using an IFrame.
  • Frame Border – turns the frame border on or off.

NOTE: In some installations, .js files may be prohibited from uploading; in this case, rename the file to use a .txt extension instead of .js.. 

Example

 “World Clock” JavaScript rendered through the web part:

 HTML JS Render Web Part Example

 

 

Last edited Dec 17, 2012 at 3:05 PM by DavidMSterling, version 2

Comments

No comments yet.