Script Editor web part automatically deletes itself

Hello Community
    On a Team Site there is a web part in a web part zone on a page
and a Script Editor web part was also added to the web part zone.
    After the Script Editor web part was added CSS code was inserted into
the Script Editor web part and the page worked fine.
    Then soon after modifying some other parts of the page
when I run the page some more the Script Editor web part vanishes even
though I never touched it again because that web part worked fine.
    What could make a web part to delete from a web part zone on a page?
    Thank you
    Shabeaut

Hi,
Thanks for your Sharing.
Best Regards,
Lisa Chen
Lisa Chen
TechNet Community Support

Similar Messages

  • Web Part specific DOM Manipulation. Two identical Script Editor Web Part code blocks.

    We have a script editor web part with javascript that references some jquery libraries.  The code creates web part properties and hides  DIV tag in the web part based on some conditions.  It works great until I try to place the same exact
    web part / code block on the same page twice. The way we are rolling this out we don' t users messing the code and we want the WP properties UI to be identical on both Web Parts.
    Given all this.. is it possible with jquery code to perform Web Part specific DOM manipulation without any conflict with other similar Web Parts and Script editor code blocks on the page?  Possible to dynamically change DIV Tag IDs, Jquery Variables
    and WP Properties to have the unique web part GUID?
    Possible?  Any ideas would be appreciated.
    demo of issue here:
    http://screencast-o-matic.com/watch/coeUlneNT6
    Code in question:

    Hi,
    I suggest you debug your code using IE F12 developer tools. Based on your description, you can try to add some conditions base on the web part ID.
    Or you can share your full code for further research.
    Best Regards,
    Dennis Guo
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Custom SharePoint Master Page with Content Editor Web Part.

    Hi All,
    I have created a custom SharePoint Master Page to apply within my SharePoint Site and it was a success.
    When I want to add the content I have to use the script editor web part and add HTML snippets. Then the styles will reflect correctly. But when I use content editor web part some of the styles do not reflect. Lets assume that if I want to add a H2 with the
    custom color, the color do not show in the ribbon. And how SharePoint know that this is an <h2> and reflect the other styles like padding, margin and so on.
    Please can someone help me to solve this.
    Thanks and regards,
    Chiranthaka

    Hi,
    From your description, my understanding is that you want to add CSS code in your customized Master Page with content editor web part.
    I tested your issue in SharePoint Designer, and I added CSS code successfully.
    I accomplish your requirement with steps below:
    Add a content editor web part in a list and add some CSS code in the web part.
    Open SharePoint Designer, enter the master page.
    Insert a content editor web part under INSERT tab in the Ribbon.
    Open the list that have edited in step1 in the SharePoint Designer.
    Copy code from the list to the Master Page as the screenshot below.
    The screenshot below is my result:
    In addition, why do not you add CSS code just with <style> tag in your page? Just add CSS code as below(in this method, you do not need any web part.):
    <style>
    h2{
    background-color:green;
    </style>
    Best Regards,
    Vincent Han
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Relative Path for Jquery into Content Editor Web Part

    Hi;
    I'd add a Content Editor Web Part (CEWP) to a web part zone. I'd edit that CEWP in HTML view and add my script which load Jquery and my question :  how to use a relative
    path for Jquery :
    <SharePoint:ScriptLink Name="SP.js" runat="server" OnDemand="true"
      Localizable="false" />
    <script src="/sites/XXX/Style%20Library/Scripts/jquery.min.js" type="text/javascript"></script>
    <script type="text/javascript">
    My code
    </script>
    Regards

    Hi;
    Firstly, I have used : 
    <script src="/Style%20Library/Scripts/jquery.min.js" type="text/javascript"></script>
    But any result and any change and If I add /Sites/XXX/ : it works correctly ?
    My code is :
    <SharePoint:ScriptLink Name="SP.js" runat="server" OnDemand="true"
        Localizable="false" />
    <script src="/sites/XXX/Style Library/Scripts/jquery.min.js" type="text/javascript"></script>    
    <script type="text/javascript">
    ExecuteOrDelayUntilScriptLoaded(displayTitle, "SP.js");
    var site;
      var context;
      function displayTitle() {
        //Get the current client context
        context = SP.ClientContext.get_current();
        //Add the site to query queue
        site = context.get_web();
        context.load(site);
        //Run the query on the server
        context.executeQueryAsync(onQuerySucceeded, onQueryFailed);
    function onQueryFailed(sender, args) {
      alert('request failed ' + args.get_message() +
        '\n' + args.get_stackTrace());
    function onQuerySucceeded(sender, args) {
        $("#layoutsTable table th span").html("Bienvenue sur le site " + site.get_title() + " - Direction Technique");
        $("#zz17_V4QuickLaunchMenu ul.root li span:contains('Biblioth')").parent().parent().hide();
        $("#zz17_V4QuickLaunchMenu ul.root li span:contains('Listes')").parent().parent().hide();
    </script>

  • Disable link for a Image in Content editor web part

    Hi
    i want to disable hyperlink for a banner added using content editor web part. Instead of hiding using Target Audience, i want to disable the link.
    Please help me how can i achieve this?
    regards,
    Vinay
    Thanks and Regards, vinnu

    Hi Vinay,
    I recommend to disable the link for an image using Jquery in Content Editor web part.
    First, you need to use F12 tool in Internet Explorer(IE) to get the html tag for the image, and you’d better find the class or id value for the tag of the image.
    For example, if the class for the image is test, then the code should be:
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.8.2.js"></script>
    <script type="text/javascript">
    $('.test').click(function(e) {
    e.preventDefault();
    </script>
    You can also paste the code of the image here for further research.
    Best regards.
    Thanks
    Victoria Xia
    TechNet Community Support

  • SharePoint 2013 Client Side People Picker in Content Editor Web Part

    Has anyone tried to use the client side people picker in a content editor web part? I have successfully got it to work in IE by adding all the script references and initialize function to the content editor web part. Now the strange part is, the people
    picker doesn't render in other browsers, I tried in Chrome, Safari, and Firefox. Any ideas?

    Below can be used to create people picker in CEWP
    <asp:content contentplaceholderid="PlaceHolderAdditionalPageHead" runat="server">
    <script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.6.2.min.js" type="text/javascript"></script> 
       <script type="text/javascript" src="../Apps/_layouts/15/clienttemplates.js"></script> 
       <script type="text/javascript" src="../Apps/_layouts/15/clientforms.js"></script> 
       <script type="text/javascript" src="../Apps/_layouts/15/clientpeoplepicker.js"></script> 
       <script type="text/javascript" src="../Apps/_layouts/15/autofill.js"></script> 
       <script type="text/javascript" src="../Apps/_layouts/15/sp.js"></script> 
       <script type="text/javascript" src="../Apps/_layouts/15/sp.runtime.js"></script> 
       <script type="text/javascript" src="../Apps/_layouts/15/sp.core.js"></script> 
       <script type="text/javascript">
    <!-- Add your CSS styles to the following file -->
    <link rel="Stylesheet" type="text/css" href="../SiteAssets/PeoplePicker/App.css"/>
    <!-- Add your JavaScript to the following file -->
    // Run your custom code when the DOM is ready.
    $(document).ready(function () {
        // Specify the unique ID of the DOM element where the
        // picker will render.
        initializePeoplePicker('peoplePickerDiv');
    // Render and initialize the client-side People Picker.
    function initializePeoplePicker(peoplePickerElementId) {
        // Create a schema to store picker properties, and set the properties.
        var schema = {};
        schema['PrincipalAccountType'] = 'User,DL,SecGroup,SPGroup';
        schema['SearchPrincipalSource'] = 15;
        schema['ResolvePrincipalSource'] = 15;
        schema['AllowMultipleValues'] = true;
        schema['MaximumEntitySuggestions'] = 50;
        schema['Width'] = '280px';
        // Render and initialize the picker. 
        // Pass the ID of the DOM element that contains the picker, an array of initial
        // PickerEntity objects to set the picker value, and a schema that defines
        // picker properties.
        this.SPClientPeoplePicker_InitStandaloneControlWrapper(peoplePickerElementId, null, schema);
    // Query the picker for user information.
    function getUserInfo() {
        // Get the people picker object from the page.
        var peoplePicker = this.SPClientPeoplePicker.SPClientPeoplePickerDict.peoplePickerDiv_TopSpan;
        // Get information about all users.
        var users = peoplePicker.GetAllUserInfo();
        var userInfo = '';
        for (var i = 0; i < users.length; i++) {
            var user = users[i];
            for (var userProperty in user) { 
                userInfo += userProperty + ':  ' + user[userProperty] + '<br>';
        $('#resolvedUsers').html(userInfo);
        // Get user keys.
        var keys = peoplePicker.GetAllUserKeys();
        $('#userKeys').html(keys);
    </script>
    </asp:content> 
    <asp:content contentplaceholderid="PlaceHolderMain" runat="server">
    <div id="peoplePickerDiv"></div>
        <div>
            <br/>
            <input type="button" value="Get User Info" onclick="getUserInfo()"></input>
            <br/>
            <h1>User info:</h1>
            <p id="resolvedUsers"></p>
            <h1>User keys:</h1>
            <p id="userKeys"></p>
        </div>
    </asp:content>​​​​​​​​​
    Vishnu

  • Content Editor Web Part Blocked Me Out

    I was working on updating my department's Sharepoint site. While in Edit mode, I clicked
    on a link titled "Add a Web Part" and began looking at the different Web Parts to add. When I clicked on a blank one, I was unsure of what it would do, so I did not click add, I closed the screen with the "x" button thinking it would not
    save. I was wrong. After closing the screen and opening back up the page, all I see is is a bar saying "Content Editor Web Part" and I cannot access any of the links above to edit the page. Please help!!!

    Hello,
    It seems you have added the CEWP on page. To delete thsi webpart just open the page once again and add "?contents=1" at the end of URL. Now it will show all added webpart on page, you can delete unwanted webpart from page.
    Refer this link for shortcut links:
    http://artykul8.com/2011/03/useful-sharepoint-shortcuts/
    Hope it could help
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • Add Tab ability to Content Editor Web Part

    Just wondering if there is an easy way to add a content editor Webpart to a SharePoint Online (office 365) SharePoint site where the code in the CEWP would created 2 tabs and the user could then put different content to display on each tab.  When a
    user clicks the other tab, the CEWP switches to that content.
    Thanks!

    Hi,
    According to your description, my understanding is that you want to create a tab and when switch the tab to display different content in SharePoint Online site.
    I suggest you can use Jquery API tabs plugin to achieve it. You can add a content editor web part and then add Jquery code in it.
    Here is a code snippert for your reference:
    <!doctype html>
    <html lang="en">
    <head>
    <meta charset="utf-8">
    <title>jQuery UI Tabs - Default functionality</title>
    <link rel="stylesheet" href="//code.jquery.com/ui/1.11.3/themes/smoothness/jquery-ui.css">
    <script src="//code.jquery.com/jquery-1.10.2.js"></script>
    <script src="//code.jquery.com/ui/1.11.3/jquery-ui.js"></script>
    <link rel="stylesheet" href="/resources/demos/style.css">
    <script>
    $(function() {
    $( "#tabs" ).tabs();
    </script>
    </head>
    <body>
    <div id="tabs">
    <ul>
    <li><a href="#tabs-1">Nunc tincidunt</a></li>
    <li><a href="#tabs-2">Proin dolor</a></li>
    <li><a href="#tabs-3">Aenean lacinia</a></li>
    </ul>
    <div id="tabs-1">
    <p>Test1</p>
    </div>
    <div id="tabs-2">
    <p>Test2</p>
    </div>
    <div id="tabs-3">
    <p>Test3</p>
    </div>
    </div>
    </body>
    </html>
    More information for your reference:
    Jquery Tabs
    Thanks
    Best Regards
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected]
    Jerry Guo
    TechNet Community Support

  • Resize Content Editor Web Part to Page Width

    I have a content editor web part in page.   The CEWP contains a javascript based menu and an Iframe.
    The problem is that when I resize the page, the width of the CEWP does not size to the width of the browser.
    How can I get the CEWP to resize to the browser?John Bailo

    John, can you provide insight on the script you used for this? I'm trying to accomplish the same thing.

  • Out of the box web part automatically redirect to another page while setting properties

    Hi
    I have a situation where by if I click the + sign in front of a grouped property to customize the individual properties of a web part - the web part automatically redirects away to another page.
    A typical example is the "Table of Content" web part in the attached image.  If I click the + sign in front of either Content, presentation or Organization then the web part just closes off and the page redirects away.  I am able to
    open the + sign in front of Appearance, Layout & Advanced.
    Environment is SharePoint 2010, Service Pack 1 and highest hot fix is
    KB2597150.
    Has anyone experienced this to be able to advise a fix?

    Hi Andy,
    Thanks for your response and at least problem identified.
    No custom code but the only java script is on the master page which incorporates OnClick events for google analytics.  I have removed it and it seems to stop that behavior.  Root cause now known and I can investigate further.
    Thanks
    S.

  • Uploading multiple documents into sharepoint list item with REST in sharepoint 2013 using content editor web part :

    hi ,
    i am trying to upload multiple document files into sharepoint list item. I followed below link for implementaion.
    http://techfindings-prem.blogspot.in/search/label/jquery.multifilejs
    It was working for sharepoint hosted app.
     This complete code is written within content edito web part.
    It was working when i was in root site collection with below change (hard coded the root level url) in code in "UploadFile" function.
    var scriptbase = "http://servername" + "/_layouts/15/";
                console.log(' File size:' + bytes.length);
                $.getScript(scriptbase + "SP.RequestExecutor.js", function () {
                    var createitem = new SP.RequestExecutor("http://servername");
                    createitem.executeAsync({
                        url: "http://servername/sites/cpg/" + "/_api/web/lists/GetByTitle('SalesRecord')/items(" + attachmentitemid + ")/AttachmentFiles/add(FileName='"
    + fileName + "')",
                        method: "POST",
                        binaryStringRequestBody: true,
                        body: binary,
                        success: fsucc,
                        error: ferr,
                        state: "Update"
                    function fsucc(data) {
                        //alert( data.statusText + "\n\n" + data.responseText);
                        console.log(data + ' uploaded successfully');
                        deferred.resolve(data);
                    function ferr(data) {
                        //alert( data.statusText + "\n\n" + data.responseText);
                        console.log(fileName + "not uploaded error");
                        deferred.reject(data);
    But the issue came in picture when i was working with the other site collection instead of root one. The url was like below.
    "http://servername/sites/cpg/". This time i need to be there within "cpg" site collection. 
    Now if i hard code the url as i did above my code gets break here while come to below line
     $.getScript(scriptbase + "SP.RequestExecutor.js", function () {
    I am getting error when i used below code:
    var scriptbase = "http://servername" + "/_layouts/15/";
     $.getScript(scriptbase + "SP.RequestExecutor.js", function () {
                    var createitem = new SP.RequestExecutor("http://servername");
                    createitem.executeAsync({
                        url: "http://servername/sites/cpg/" + "/_api/web/lists/GetByTitle('SalesRecord')/items(" + attachmentitemid + ")/AttachmentFiles/add(FileName='"
    + fileName + "')",
                        method: "POST",
                        binaryStringRequestBody: true,
                        body: binary,
                        success: fsucc,
                        error: ferr,
                        state: "Update"
                    function fsucc(data) {
                        //alert( data.statusText + "\n\n" + data.responseText);
                        console.log(data + ' uploaded successfully');
                        deferred.resolve(data);
                    function ferr(data) {
                        //alert( data.statusText + "\n\n" + data.responseText);
                        console.log(fileName + "not uploaded error");
                        deferred.reject(data);
    Please hekp in this case. This complete code is written within content edito web part. 
    Regards:
    Sanjay Joshi

    Hi,
    According to your post, my understanding is that you have an issue about upload multiple documents files into library vai REST API.
    As you have said, you have used the hard code url in your code.
    How about use the _spPageContextInfo.webAbsoluteUrl method to get the url?
    I have used this method to get the url, then use the code in the article you have pasted within a content editor web part to upload the files.
    You can replace the hard code url with the _spPageContextInfo.webAbsoluteUrl method, then check whether it works.
    Thanks,
    Jason
    Jason Guo
    TechNet Community Support

  • Target Audiences in Content editor web part created from Snippet Gallery

    Hi,
    I have created a Content editor web part from the Snippet Gallery in SP 2013 Office 365 and placed it in my master page.  It works, but not the Target Audiences.  It's linking to a text file which displays, but I only want certain AD groups
    to be able to view. Everyone can see the web part. 
    Any help would be appreciated.
    Thank you!

    I am having the same issue.  Did you ever resolve it?

  • How to modify title and tooltip text in Content Editor web part

    I have inherited a site with a page that includes two Content Editor web parts. The web parts have been left with the default titles (Content Editor [1] and [2]) and mouse-over text.
    I want to set these to something more appropriate so I choose the option Edit Page (to edit the web parts on this page). I can move the web parts around (so definitely in Edit mode) but if I click the Edit Web Part Properties the page refreshes but no properties
    or options (or errors) appear.
    How do I modify these web parts?

    When you select the edit web part options, the page should reload with the configuration options on the right hand side. This will include several collapsed sections, namely: -
    Appearance
    Layout
    Advanced
    If you maximise the appearance one, you'll see a text field for "Title."  Edit this to what you want and you'll be able to rename these.
    If you can't see the options, make sure to scroll to the far right hand side of the screen.  Sometimes on larger resolution monitors, they can appear hidden.
    Steven Andrews
    SharePoint Business Analyst: LiveNation Entertainment
    Blog: baron72.wordpress.com
    Twitter: Follow @backpackerd00d
    My Wiki Articles:
    CodePlex Corner Series
    Please remember to mark your question as "answered" if this solves (or helps) your problem.

  • Add a content editor web part to right side of to default searchresults layout in search center

    i need to display a content editor webpart in right side of search results page
    Is it possible to do it without making changes to the layout.In page i dont have a webapart zone
    on right side to add content editor to right.Is it possible to add it to right side without making changes to default searchresults layout

    Hi,
    Based on your description, my understanding is that in your production environment, it doesn't search the contents of Content Editor webparts.
    It is by default in SharePoint that Contents in a content editor web part aren't searchable .
    You can create a content source that crawls web pages it will pick up the contents of a content editor web part.
    Here are some similar post, you can use as a reference:
    https://social.technet.microsoft.com/Forums/en-US/148464b3-6229-4e33-b5cd-826119c9adf1/can-you-search-a-content-editor-web-part?forum=sharepointsearchlegacy
    https://social.technet.microsoft.com/Forums/en-US/d50273ee-8eec-4291-bee5-1817182026d9/wss-30-content-editor-web-part-not-searched?forum=sharepointsearchlegacy
    Best Regards,
    Lisa Chen

  • Creating a persistent check box in a Content Editor Web Part

    I'm using the following HTML in a Content Editor Web Part to display a check box.  It works great, but how can I make the checkbox state persistent? (i.e, it remembers whether it is checked or not between sessions).
    HTML: <input name="Completed" type="checkbox" value="Completed"  />

    Hi
    Adoukusa ,
    For creating a persistent check box in a Content Editor Web Part, you need to use cookie to store the state of the checkbox and maintain the state by reading / writing cookies.
    Here is JavaScript cookie sample code:
    function createCookie(name,value,days) {
    if (days) {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();
    else var expires = "";
    document.cookie = name+"="+value+expires+"; path=/";
    function readCookie(name) {
    var nameEQ = name + "=";
    var ca = document.cookie.split(';');
    for(var i=0;i < ca.length;i++) {
    var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
    return null;
    function eraseCookie(name) {
    createCookie(name,"",-1);
    Reference:
    http://stackoverflow.com/questions/1154258/persistence-of-checkbox-values
    Best Regards,
    Eric
    Eric Tao
    TechNet Community Support

Maybe you are looking for

  • How to get IMEI number of ME using proactive command

    Can anyone send me a sample code to get IMEI number of mobile equipment using proactive commands....

  • Leopard to Snow Leopard can i use a large flash drive to backup first?

    I've been using Leopard for 4 years with no problems.  Since Google decided to stop support for Leopard, and I use Chrome a lot I decided to upgrade.  I won't be upgrading to Mountain Lion right right away. I ordered my Snow Leopard disks from Apple.

  • How to stop MBP mid 2010 having lots of Kernel Panics?

    I got my first MBP in mid 2010...by that time it was the high end 15' MBP (Processor  2.66 GHz Intel Core i7, Memory  4 GB 1067 MHz DDR3, Graphics  NVIDIA GeForce GT 330M 512 MB). After 4-5 months of purchasing it I started having a lot of crashes ou

  • Firefox does not start by clicking on the icon in RHEL 5.

    Firefox does not start by clicking on the icon in RHEL 5 on thin clients, also the internet proxy server usename is not accepted for java applets on webpages. However while using Firefox on the servers directly everthing works fine. This issue occurs

  • Permission errors cannot be fixed

    I used RDC from my snow leopard laptop to win2003 server. It's fine in most cases but sometimes it doesn't show the remote desktop after successfully login (or timeout re-login ) . When that happened, I can only force quite the app. It's funny I got