Friday, December 5, 2014

How to redirect a page in SharePoint with JavaScript

There are many ways to redirect a page in SharePoint - embedding code in the page itself, or using some tools that need to be installed on the web front-ends. The code might not be an option for everyone (you need Visual Studio) and the tools have their additional administration overhead.

If you don't have any URL rewrite modules like Helicon or the free one from Microsoft or you simply don't want to use such tools, here's an easy script that will help you redirect users from a SharePoint page to any location.

Just add that in a Content Editor Web part and that should be all working.

<script type="text/javascript">
window.location = "http://<the desired URL here>"

Hope you find that helpful.

No comments:

Post a Comment