0

I have some HTML script that basically displays a countdown clock in a Web Part on SharePoint 2013. We don't have SharePoint Designer and uploading .html documents are blocked from our implementation.

Is there any way around this?

Here is the script I want to upload.

<script language="JavaScript">
TargetDate = "05/25/2018 0:00 AM";
BackColor = "palegreen";
ForeColor = "navy";
CountActive = true;
CountStepper = -1;
LeadingZero = true;
DisplayFormat = "%%D%% Days, %%H%% Hours, %%M%% Minutes, %%S%% Seconds.";
FinishMessage = "It is finally here!";
</script>
<script language="JavaScript" src="//scripts.hashemian.com/js/countdown.js"></script>
8
  • 5
    Simply add your code to script editor webpart in your SharePoint page Commented Jun 28, 2017 at 12:56
  • I'm going add my own answer here - but you can upload a document with the syntax <filename>.html.txt.
    – Ken
    Commented Jun 28, 2017 at 15:06
  • the insert a CEWP and link to this new document. IT WORKSSSS
    – Ken
    Commented Jun 28, 2017 at 15:06
  • it's the same method, just add SEWP with your code , instead of upload this page file then add a link to CEWP, the main job of script editor webpart is to hold script! do you try it to know how much it simple and efficient than CEWP! especially you are using SP 2013! Commented Jun 28, 2017 at 15:09
  • I personally find the linked file in CEWP option to be more helpful for code I might update multiple times. That way I don't have to roll back version history on my entire page to reference the old code, in case I've changed other page elements as well in the interim.
    – Brendan W
    Commented Jun 28, 2017 at 16:51

1 Answer 1

3

You can easily add your script within Script Editor Web Part in your SharePointPage as the following:

  • Edit your page.
  • Add Script Editor Web Part.

enter image description here

  • Edit Snippet.
  • Add your code script.

enter image description here

  • Click insert, Stop page editing.

Output

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.