I am trying to add a 'back a page' link in SharePoint using
<a href="javascript:history.back();">[Go Back]</a>
But as soon as I save the page, it removes the javascript link. Is there another way I should be doing it?
Thanks
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It only takes a minute to sign up.
Sign up to join this communityI am trying to add a 'back a page' link in SharePoint using
<a href="javascript:history.back();">[Go Back]</a>
But as soon as I save the page, it removes the javascript link. Is there another way I should be doing it?
Thanks
Fortunately I lately also needed a back button, so I can give you a working solution for it: Just simply add this Code to a Script Editor Web Part or Content Editor Web Part on the Site where u want it.
<input type="button" value="back" onclick="window.history.back()"
style="color: white; background-color:rgb(196, 196, 196);
font: 15px arial, sans-serif; font-weight: bold;" />
Follow below mentioned steps :
try this
<button class="btn btn-default" type="button" onclick="history.go(-1);" id="btBack">Back</button>