Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

SharePoint custom page

Posted on 2013-01-22
2
Medium Priority
?
339 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 44

Accepted Solution

by:
Rainer Jeschor earned 1000 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 1000 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The recent Microsoft changes on update philosophy for Windows pre-10 and their impact on existing WSUS implementations.
This article explains how to install and use the NTBackup utility that comes with Windows Server.
This tutorial will walk an individual through setting the global and backup job media overwrite and protection periods in Backup Exec 2012. Log onto the Backup Exec Central Administration Server. Examine the services. If all or most of them are stop…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

722 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