Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Stop SharePoint App page refreshing and losing data.

$
0
0

Hi,

I am trying to stop a SharePoint 2013 App Default.aspx page from refreshing and losing the changes to text. Every time I press the button the appended text appears for a few seconds than disappears after a few seconds as the app page refreshes.

1) Default.aspx
  
    <asp:ContentContentPlaceHolderID="PlaceHolderMain"runat="server">

          <button>Insert span element at the end of each p element</button>

          <p>This is a paragraph.</p>

          <p>This is another paragraph.</p>

     </asp:Content>

2) App.js

$(document).ready(function () {

    $("button").click(function () {

        $("<span>Hello World!</span>").appendTo("p");

    });

});

I am fairly new to SharePoint 2013 App development so I’m probably missing something simple.

I hope you can help
CEBlueSky


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>