Solved

SharePoint custom page

Posted on 2013-01-22
2
281 Views
Last Modified: 2013-03-06
Hello,

I have couple lines of Javascript which when put in a simple HTML page loads a small div.

How can I put this on a SharePoint page and load it the same way.

This script is like using jQuery JS file and loads a div using a function...

I have also put this on the SharePoint page using the designer, but nothing loads...

Thanks
0
Comment
Question by:masdf123
2 Comments
 
LVL 44

Accepted Solution

by:
Rainer Jeschor earned 250 total points
ID: 38808633
Hi,

that depends. You can either use SharePoint designer or add a CEWP (Content Editor Web Part).
Which SharePoint version do you use?
Can you ensure that jQuery is loaded?
Can you ensure that the jQuery selector finds the div?

Perhaps you can attach your script, some part of the page html code (the generated one, not the ASPX markup) and/or a screenshot (what should go where).

HTH
Rainer
0
 
LVL 15

Assisted Solution

by:colly92002
colly92002 earned 250 total points
ID: 38809465
In SP 2010, I create a custom masterpage (by copying het default master page and editing it, then making this new version the default on any pages that need it using Sharepoint designer) and add something like this to it:

<body scroll="no" onload="if (typeof(_spBodyOnLoadWrapper) != 'undefined') _spBodyOnLoadWrapper();" class="v4master">
  <form runat="server" onsubmit="if (typeof(_spFormOnSubmitWrapper) != 'undefined') {return _spFormOnSubmitWrapper();} else {return true;}">
  <asp:ScriptManager id="ScriptManager" runat="server" EnablePageMethods="false" EnablePartialRendering="true" EnableScriptGlobalization="false" EnableScriptLocalization="true" >
  <Scripts>
	<asp:ScriptReference Path="<% $SPUrl:~sitecollection/Style%20Library/js/jquery-1.7.1.min.js%>"  runat="server"></asp:ScriptReference> 
        <asp:ScriptReference Path="<% $SPUrl:~sitecollection/Style%20Library/js/RenameILikeIt.js%>" runat="server"></asp:ScriptReference> 
        <asp:ScriptReference Path="<% $SPUrl:~sitecollection/Style%20Library/js/CESASecurity.js%>" runat="server"></asp:ScriptReference> 
	</Scripts> 
  </asp:ScriptManager>

Open in new window


I'm using a ScriptManager object at the top of the <body> tag after the <form> tag , and I include my jQuery files there.  I have hosted my jQuery files in the "Style Library" which is a standard library available in teh Sharepoint site collection.

Once this is working, I wrap this all up into a Visual Studio solution package for deployment, but that stage is only neccessary if you want to be able to build solutions.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
OfficeMate Freezes on login or does not load after login credentials are input.
This tutorial will walk an individual through the steps necessary to configure their installation of BackupExec 2012 to use network shared disk space. Verify that the path to the shared storage is valid and that data can be written to that location:…
This tutorial will show how to configure a single USB drive with a separate folder for each day of the week. This will allow each of the backups to be kept separate preventing the previous day’s backup from being overwritten. The USB drive must be s…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now