1. 程式人生 > >Notebook of Information Technology

Notebook of Information Technology

網上經常有人想要實現不重新整理從伺服器取資料的需求。本人理解就是區域性重新整理或者是隱藏重新整理。有點象“偷偷摸摸”地從伺服器拿資料而不讓使用者發覺的意思。本人想要實現區域性重新整理的思路是出於以下考慮的:
    當用戶點選一個應用選單後,要將此選單程式碼儲存在資料庫中,而且要在“最近使用過的選單”中顯示出來。因為應用選單項非常多,重新整理一次要消耗相當多的資源,所以就想只重新整理“最近使用過的選單”,因為只取前十項,所以速度很快。

    ajax對我來說目前還比較新鮮,目前沒有涉及相關的技術。聽說在網路應用中有著相當的優勢,看來我也得不斷地學習...

    以下是我今日實現的網頁區域性重新整理的例子。


在網頁ref.htm中以iframe方式呼叫ref1.htm. 點選在ref.htm中按鈕ddd,只重新整理iframe中的ref1.htm.
顯示的是重新整理後的時間,以示清淅。
可以用F5重新整理感受一下同時重新整理與區域性重新整理的區別。
兩個小程式如下:


ref.htm
----------------------------------------------
<html>
<body onload='dis()'>
<div id=f style="position:absolute;top:100;left:100;width:300;height:300;background-color:#9999FF;">
<iframe id=ref1 src="ref1.htm"></iframe>
</div>
<button name=fr onclick="javascript:ref1.location.reload()">ddd</button>
<span id=cnt>wwww<span><br>
<script language=javascript>
function dis(){
var d=new Date();
cnt.innerHTML="<b>"+d+"</b>";
}
//if (document.readyState!="complete") return ;
</script>

</body>
</html>

ref1.htm
----------------------------------------------
<html>
<body>
<span id=cnt>ssss<span><br>
<script language=javascript defer>
cnt.innerHTML="<b>"+new Date()+"</b>";
</script>
</body>
</html>

我要將些重新整理方式應用到一個業務網站上去。

將ref.htm改為以下,可以實現定時重新整理。這裡設定的是每秒重新整理一次。實際應用時,此重新整理
頻率可能要影響伺服器的效能,可設定為每隔5到10分鐘重新整理一次。

<html>
<body onload='dis()'>
<div id=f style="position:absolute;top:100;left:100;width:300;height:300;background-color:#9999FF;">
<iframe id=ref1 src="ref1.htm"></iframe>
</div>
<button name=fr onclick="javascript:ref1.location.reload()">ddd</button>
<span id=cnt>ssss<span><br>
<script language=javascript>
function dis(){
var d=new Date();
cnt.innerHTML="<b>"+d+"</b>";
re();
}
void function re()
{
 ref1.location.reload();
 setTimeout("re()",1000);
}
</script>
</body>
</html>

相關推薦

Notebook of Information Technology

網上經常有人想要實現不重新整理從伺服器取資料的需求。本人理解就是區域性重新整理或者是隱藏重新整理。有點象“偷偷摸摸”地從伺服器拿資料而不讓使用者發覺的意思。本人想要實現區域性重新整理的思路是出於以下考慮的:    當用戶點選一個應用選單後,要將此選單程式碼儲存在資料庫中,而且

Long Wei information technology development Limited by Share Ltd interview summary.

oom interview ews per cal repl was form roo Long Wei information technology development Limited by Share Ltd interview summary. I take pa

Thoughts on the Application of Radar Technology to the Improvement of Street Light System

Abstract: Street lights are everywhere in people’s daily lives. But street lights can sometimes cause problems for people. First of all, long-term

Homework1 of information basis II

The question1: what the normed linear space(賦範線性空間) is? For sloving the question, I will divide it into two parts, which are norm and linear space!

information technology software

Microsoft has announced an experimental release of "Robot Operating System (ROS1)" for Windows as a next step in bringing features like Machine Learning (M

Information Technology

What do you mean by ethics for artificial intelligence? Well, that's a good starting point because there are different sorts of questions that are being as

The future of Information Architecture: Machine Learning, Voice User Interface and Augmented…

The future of Information Architecture: Machine Learning, Voice User Interface and Augmented RealityIntroductionIn the information age we live in, it’s mor

Nanoscale pillars as a building block for future information technology

In today's information technology, light and electron charge are the main media for information processing and transfer. In the search for information tec

information technology services

As technology has continued to accelerate in recent decades, workers throughout many industries have faced an increasingly real threat of having their posi

ELI5: The Ins & Outs of Blockchain Technology

So, what is Blockchain?(Note: There are a variety of different blockchain implementations that exist today. For the sake of keeping it simple this section

information technology hardware

Volvo has teamed up with Nvidia to use the latter's Drive AGX Xavier platform in its next generation of cars set to hit the road early next decade. An earl

 blockchain use cases that highlight the real potential of the technology

Blockchain might be a cryptocurrency enabler, but its real potential goes beyond digital coins. Viable blockchain use cases have proven that the distribute

Ask HN: Any good tools or techniques for memorising lists of information?

I’m interested by the idea of being able to efficiently memorise long lists or tables of useful information, and being able to ‘look up’ items reliably wit

Information Technology News

Monday, December 3, 2018 Thursday, November 29, 2018 Wednesday, November 28, 2018 Tuesday, November 27, 2018 Monday, November 26, 2018 Wednesday, Nove

Resource of MS technology.txt

Microsoft技術學習我的心得 ---1 覺得比較好的學習途徑--- 1 MS ** Starter Kits: 我認為是學習MS某項技術入門的好途徑,可以很快的入門,英文版。   例如:http://www.microsoft.com/en-us/download/d

Introduction to Information Technology/G 4478/8936

eva change fashion argument nging intern ret dir sign Programming AssignmentIntroduction to Information Technology/G 4478/8936Note 1: Onl

Reading notes 《A survey on question answering technology from an information retrival perspective》

語料庫 aud 解析 nal rspec -o log notes alua concise adj 簡潔的 audio fragment 音頻片段 revivial n 復興 condense v.壓縮; 精簡;(使)冷凝;(使)凝結; formulation n 公式

Classical wave-optics analogy of quantum-information processing

ant 頻率 系統 差異 自由 概念 enter call cal 量子信息處理的經典波-光模擬(Spreeuw 2002 PRA) 《經典波光學.pdf》 核心:   1. 只有‘局域糾纏’ 有經典模擬!      基於經典波光學的模擬模型系統,應用於3個涉

兩招解決異常_Cannot find any information on property 'XXX' in a bean of type 'XXX'的問題

第一招  在進行Java Web專案開發的時候,我碰到過下面這個異常: Cannot find any information on property 'XXX' in a bean of type 'XXX' 如圖:   這是javaBean中: 這是

Radar Guidance Technology and the Solution of Social Problems in China

Radar Guidance Technology and the Solution of Social Problems in China Radar Guidance Technology of Guiding Missile to Target by Radar Guidance