如何在重定向之前使页面着色并显示消息。 [英] How to make a page shaded and display a message before it gets redirected.

查看:54
本文介绍了如何在重定向之前使页面着色并显示消息。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好


我有一个sharepoint页面,一旦加载就会导航到另一个页面。但只需几秒钟,用户就可以看到页面的内容。我需要通过将页面背景设置为阴影并显示一条消息来阻止此操作,例如"此
页面正在导航"。


这是内部2013的sharepoint。是否存在有可能在Javascrip或任何其他方式实现这一目标。请建议。



问候,


Chaitanya。

解决方案

您好,


您的要求可以通过JavaScript实现。


显示消息在页面重定向之前的窗口,转到页面并编辑页面,在"媒体和内容"下插入"脚本编辑器"Web部件,并将下面的脚本粘贴到"脚本编辑器"Web部件中。


这是一个例子。

< script type =" text / javascript"> 
   &NBSP; window.onload = function PageOpenAction(){
   &NBSP;警报("此页面正在导航。");
  &NBSP;   window.location =" http://SharePointSite/SitePages/DestinationPage.aspx " ;;
      return true;
}
< / script>

祝你好运,


Chelsea Wu


Hi

I have a sharepoint page, that gets navigated to another page as soon as it gets loaded. But for a fraction of seconds users are able to see the content of the page. I need to stop this by making the page background shaded and display a message like, "This page is getting navigated".

This is sharepoint on premises 2013. Is there a possibility to achieve this in Javascrip or any other way. Please advice.

Regards,

Chaitanya.

解决方案

Hi,

Your requirements can be achieved by JavaScript.

To display a message window before the page is redirected, go to the page and edit the page, insert "Script Editor" web part under Media and Content and paste the scripts below in the Script Editor web part.

Here’s an example.

<script type="text/javascript">
     window.onload = function PageOpenAction(){
     alert("This page is getting navigated.");
     window.location = "http://SharePointSite/SitePages/DestinationPage.aspx";
     return true;
}
</script>

Best regards,

Chelsea Wu


这篇关于如何在重定向之前使页面着色并显示消息。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆