Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 12th, 2007, 08:54 AM
Registered User
Points: 1,897, Level: 17
Points: 1,897, Level: 17 Points: 1,897, Level: 17 Points: 1,897, Level: 17
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2005
Location: Mumbai, Maharastra, India.
Posts: 352
Thanks: 14
Thanked 0 Times in 0 Posts
Send a message via Yahoo to rupen
Default Reload page only once.

Hi, what is the best way to reload a page only once when user visits it.
I tried using <META ..> but as we have to specify seconds and after that second it will be refeshed again, is no use for me.
also tried with onload function but it keeps the page busy by refreshing.

In short, when user logs/visits page it should automatically refreshed but only onece.

Thanks in advance.

Rupen Anjaria.:)
------------------
It is not difficult to be on TOP...It is difficult when you carry Truth,Commitment and Transparency with you.
Reply With Quote
  #2 (permalink)  
Old September 13th, 2007, 02:22 AM
Friend of Wrox
 
Join Date: Oct 2004
Location: delhi, delhi, India.
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default

Hi Rupen!!
Ofcourse you can do this with different ways.
to do so ,u need some kind of state management techniques.
if it is normal html/htm then u can use help of cookie
or if it is generated by server-side-code asp/php/aspx/jsp etc u can use
either form field,session or query string.

once a page is loaded check the value of a variable(session variable values on client side),
if it has initial value ,reload it and increment that value.

Hope this will help you,if u have any other concept plz share with us

Cheers :)

vinod
Reply With Quote
  #3 (permalink)  
Old September 13th, 2007, 04:00 AM
Registered User
 
Join Date: Sep 2007
Location: Belgaum, Karnataka, India.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes it is possible, you can use a following function
window.setTimeout('CallMe()',limit);
  You can specify the time gap also to auto reload.
In this function try to load a session with that user. and load the page for every user once.
  May you got the logic..
Bye..

  Guru.

Guru
Reply With Quote
  #4 (permalink)  
Old September 13th, 2007, 06:00 AM
Friend of Wrox
 
Join Date: Oct 2004
Location: delhi, delhi, India.
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default

Hi Rupen!!

Since you want to reload the page only once. setTimeout function allows you to call "CallMe" function
after given timelimits,but how do u know whether the page should be reload or it is already reloaded.

e.g below code will reload the page in infinite times.

<script>
var i
i=0
window.setTimeout('CallMe()',1000);

function CallMe()
{
document.getElementById("mydiv").innerHTML=documen t.getElementById("mydiv").innerHTML+"--"+i
i++;
alert("j"+window.location.search);
location.href="tmp.html"

}
</script>
<div id="mydiv"></div>


++++++++++++++++++++++

http://www.javascriptkit.com/javatutors/send1.shtml
and next page http://www.javascriptkit.com/javatutors/send2.shtml?MyValue.value='JavaScript'&MyTest.valu e='Kit'


++++
Or
+++
here you can find out how to search a querystring .
http://www.eggheadcafe.com/articles/20020107.asp

U will have to send some info to the CallMe function ,when to reload it,for that
u have to use querystring,cookies,or if it is asp/jsp/php(server side lang) then user form fields.


Hope this will help you

Cheers :)

vinod
Reply With Quote
  #5 (permalink)  
Old September 13th, 2007, 06:34 AM
Registered User
Points: 1,897, Level: 17
Points: 1,897, Level: 17 Points: 1,897, Level: 17 Points: 1,897, Level: 17
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2005
Location: Mumbai, Maharastra, India.
Posts: 352
Thanks: 14
Thanked 0 Times in 0 Posts
Send a message via Yahoo to rupen
Default

Hey..the sission thing worked fine with me..

Thanks a lot.....

Rupen Anjaria.:)
------------------
It is not difficult to be on TOP...It is difficult when you carry Truth,Commitment and Transparency with you.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
reload parent page from included page sbkumar Javascript 2 July 24th, 2008 03:56 PM
Reload page Tooltip not work - Reload xslt file? ismailc XSLT 10 January 22nd, 2008 10:03 AM
I want page to not reload omersharp ASP.NET 2.0 Professional 0 December 13th, 2006 07:06 PM
Reload ASP page once only pablohoney Classic ASP Basics 2 August 10th, 2005 10:19 PM
Reload a page mivan2001 Javascript How-To 1 July 23rd, 2003 03:25 AM



All times are GMT -4. The time now is 07:36 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.