Jump to content

[SOLVED] Refreshing a page


Azu

Recommended Posts

How can I make it so a page refreshes once every certain amount of seconds, but it simply updates the page rather then destroying, so if someone has typed something in a form for example, it won't erase it, and it won't un-highlight things people have selected, and won't scroll up to the top of the page, etc. Unless that part of the page is removed of course.

Without javascript/activex etc.

I've been trying to figure this out for a long time.
The only ways I have come up with will only work with javascript or activex or something like that enabled, which a lot of people don't.

I'd REALLY appreciate it if somebody could offer some ideas on this. Please?  :)
Link to comment
Share on other sites

First off, you're not going to be able to save screen state and refresh at the same time without some sort of Javascript/ActiveX interference. Secondly, your comment about [i]"which a lot of people don't have enabled"[/i] is a bit far fetched. By default, Javascript is going to be enabled, and the average user won't know how to disable it. On top of that, those that do know how, typically choose not to. There have been discussions on this forum before about the percentages of javascript usage, and I believe at the most, you're talking somewhere around 5% or so.

Now, addressing the idea of refreshing the page without losing text entered and/or highlighted text, you're really getting into a very difficult line to cross. First off, highlighted text may be impossible to retain. I'll let someone that is a little more familiar with it to address it, too, but from my experience, simply finding highlighted text is challenging enough. Your best bet is to section your page into quadrants. Once you know what quadrants may have changing text, run some sort of AJAX call to update [b]that content only[/b]. You could even go so far as to compare the new text, and only update if the text has changed. That would mean that the only time you would lose user highlighting would be when the quadrant they are currently working with is when the actual content of that quadrant changes.

Although this probably isn't the answer you're looking for, I hope this helps some.
Link to comment
Share on other sites

  • 1 month later...
[quote author=obsidian link=topic=119513.msg489568#msg489568 date=1166707282]There have been discussions on this forum before about the percentages of javascript usage, and I believe at the most, you're talking somewhere around 5% or so.[/quote]

Okay.. thanks..

Well if only around 5% of people use javascript then I'm definitely gonna have to find a way to do this without javascript =\


I think if I put every sentence in it's own iframe (without borders) and have a meta refresh on it to refresh it every say 20 seconds that should work.. that sentence would still get un-selected though if someone was selecting that particular sentence when it got refreshes..

Any ideas on how I could fix that? Preferably without javascript since only 5% of people have it enabled..
Link to comment
Share on other sites

[quote author=Azu link=topic=119513.msg520323#msg520323 date=1170485803]
Well if only around 5% of people use javascript then I'm definitely gonna have to find a way to do this without javascript =\
[/quote]

I guess I should have been more careful [b]how[/b] I addressed the percentages. I was saying that at the most, you'd be talking about 5% or so of people with it [i]disabled[/i].
Link to comment
Share on other sites

[quote author=tarun link=topic=119513.msg521232#msg521232 date=1170598623]
Try This

[code]<meta http-equiv=refresh content="3; url=http://www.msn.co.uk">[/code]
[/quote]Thanks! That does it perfectly!

Now please excuse me while I bang go bang my head on the wall repeatedly..
Link to comment
Share on other sites

Just to put my 2 cents in, w3schools.com lists 10% as surfing with javascript turned off(near the page bottom):
http://www.w3schools.com/browsers/browsers_stats.asp

I believe those stats are from their web site traffic mostly and other popular sites.  Now someone who visits their web site frequently like me would have their web site added to their browsers list of trusted sites so therefore my js would be recorded as 'on' by  w3schools.com.  But when I am surfing unknown web sites,  I surf with js turned off for security reasons so most of my surfing is done with js turned off.  I believe many of the visitors of w3schools.com are like me and that the percentage of visitors that can be expected to surf a web site for the first time with js turned off is far larger than 10%!

--If you are going to make your web page dependant on js, always use the HTML tag NOSCRIPT to inform the web visitor that they need to turn on js to use your web page:
[code]<noscript><span style="color:red;">You need to enable javascript in order to use this web page</span></noscript>[/code]
The noscript tag only displays if js is turned off.
Link to comment
Share on other sites

[quote author=mainewoods link=topic=119513.msg521508#msg521508 date=1170636400]
I believe many of the visitors of w3schools.com are like me and that the percentage of visitors that can be expected to surf a web site for the first time with js turned off is far larger than 10%!
[/quote]

I think this may be right, but for the same reasons you posted above. People that visit W3schools are generally going to be much more technically savvy people who have good reason for turning off JS. I highly doubt that you'll have that high a number of people with it turned off for a [i]normal[/i] page. In all the pages I've run stats on, I have seen anywhere from 4-8% with it off, but never more than that. On technical sites (such as W3Schools), I think the average may be a bit higher.
Link to comment
Share on other sites

That's usually what I do. When possible, however, I like to find ways to do things without javascript and flash and that kind of stuff.

Basically there is a good reason to have something disabled (or it is disabled to begin with) then I prefer not to make my site depend on it. And javascript is often used for very annoying things such as spawning advertisements, useless pop-ups/pop-unders and resizing windows and making text move back and forth and that kind of thing. I consider this a good reason to have it disabled and so do lots of other people.

Maybe 1 out of 10 people not being able to access your site sits well with you, but it doesn't sit well with me.

No offense intended.


I think I'm going to compromise; cool features from javascript, but still functional without it.  :)
Link to comment
Share on other sites

[quote author=Azu link=topic=119513.msg521845#msg521845 date=1170691871]
I think I'm going to compromise; cool features from javascript, but still functional without it.  :)
[/quote]

And, IMHO, that is [i]precisely[/i] the best view on the matter. I agree 100% that, if possible, your site should still function without it.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.