且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在页面内容之前加载页面提示

更新时间:2023-12-05 22:28:10

嗨....


欢迎来到剧本...


为什么你不想使用ajax? :) ...无论如何......你可以制作一个有两个iframe的页面......一个显示你的加载指示器,另一个加载内容页面。第二个iframe应该有 style =" display:none" 起初......所以它是隐藏的。在你给定的时间之后(你可以在这里使用 window.setTimeout())你隐藏loading-indicator-frame并用 style =" display:block"显示content-iframe。 ...


亲切的问候
hi ....

welcome to theScripts ...

why don''t you want to use ajax? :) ... anyway ... you could make a page with two iframes ... one shows your loading-indicator the other loads the content-page. the second iframe should have style="display: none" at first ... so it is hidden. after your given time (you may use window.setTimeout() here) you hide the loading-indicator-frame and show the content-iframe with style="display: block" ...

kind regards


您可以使用这个让你开始用setTimeout替换body onload overlay调用。
You can use something like this to get you started replacing the body onload overlay call with setTimeout.


感谢你的回复,但我可以似乎没有工作......这里是我的代码:


[HTML]< head>

< title>< ; fmt:message key =" study.viewDataResult" />< / title>

< script type =" text / javascript">

function overlay(){

elem = document.getEmlementbyId(" data");

elem.style.visibility =" hidden";

elem = document.getElementById(" load");

elem.style.visibility =" visible";

}

< / script>


< / head>


< body>

< body onload =" overlay()">

< c:set var =" showTopLinks"值= QUOT; 0&QUOT; scope =" session" />

< c:set var =" showBg"值= QUOT; 0&QUOT; scope =" session" />

< table width =" 100%">


< tr>

< td>

< font class =" welcomeText">

< fmt:message key =" study.viewData.Result" /&GT; < c:out value ="
thanks for the reply however i can''t seem to get it to work.. here''s my code:

[HTML]<head>
<title><fmt:message key="study.viewDataResult"/></title>

<script type ="text/javascript">
function overlay() {
elem = document.getEmlementbyId("data");
elem.style.visibility="hidden";
elem = document.getElementById("load");
elem.style.visibility ="visible";
}
</script>

</head>

<body>
<body onload="overlay()">
<c:set var="showTopLinks" value="0" scope="session"/>
<c:set var="showBg" value="0" scope="session"/>
<table width="100%">

<tr>
<td>
<font class="welcomeText">
<fmt:message key="study.viewData.Result"/> <c:out value="