English 中文(简体)
• 如何维持和获取所有页页数可变的javascript变量?
原标题:How to maintain and access javascript variable which is accesible from all the pages?
  • 时间:2010-12-16 07:26:26
  •  标签:
  • javascript

I have a temp.js file containing global variable num which is intially set to 0. It has a function Increment() which increments the num by 1.

页: 1 这两份文件都提到节日文件。 这两页都有一个子点,我点击一个 j脚印,去另一页。 i.e,在纽芬兰的点击页1.html,I navigate to page2.html,反之亦然。

在从任何网页上浏览之前,我打电话(电话)功能。 我所看到的是南端,它总是被束缚到零,而加固功能则将其降到1。 我所希望的是,在我担任职务时,第一次将南定在0,后来又加插1。

我可以想出上述任何途径。 在我的设想中排除了使用某些类型的盘问或保持主页的价值。

问题回答

您可以撰写论文。 这是你所能做的最佳工作。

你们最好要把变量写给一个厨师。 请注意,这是现有最容易使用的方法之一,因此,如果反之以任何方式“进口”你应避免这样做。

在最后一种情况下,你最好的做法是在届会变量中储存柜台。 这将需要1)一个服务器方语言(例如PHP、ASP、Perl)2,一个星号,一个更新本届会议的服务器上的网页。

You could also have a master page, which iframed Page1.html. When you browse to Page2.html in the iframe, the parent page s context will still exist. You can then reference your global counter from the two documents in the frame using parent.counter.

然而,如果使用iframe,则在页数上增加一个额外的网上要求,并增加浏览器消耗的资源。 这也将使网站复杂化。 一台厨师的解决方案将增加你向服务器发出的每一项要求。 你的选择。





相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签