473,803 Members | 3,479 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DUMB question ? Server trip without a page refresh or reload possible ?

Mel
i would like to have a link, such that when the user clicks on it, a script
is fired to go to server and check for page updates, if any, it should
request a reload, else stay silend (terminate)

is such thing possible ?

thanks
Jul 23 '05 #1
4 2615


Mel wrote:
i would like to have a link, such that when the user clicks on it, a script
is fired to go to server and check for page updates, if any, it should
request a reload, else stay silend (terminate)

is such thing possible ?


<form action="">
then make the page an ASP or PHP (or whatever you use on the server) and
let it return the HTTP status code 204 if there is no new data,
otherwise send the new data.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #2
Mel
how can i return "HTTP status code 204" from my cgi script ?

any example is appreciated
"Martin Honnen" <ma*******@yaho o.de> wrote in message
news:42******** *************** @newsread2.arco r-online.net...


Mel wrote:
i would like to have a link, such that when the user clicks on it, a script is fired to go to server and check for page updates, if any, it should
request a reload, else stay silend (terminate)

is such thing possible ?


<form action="">
then make the page an ASP or PHP (or whatever you use on the server) and
let it return the HTTP status code 204 if there is no new data,
otherwise send the new data.
--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 23 '05 #3

if you make sure that your clients have jscript activated ( i never ge
it why the MAJORITY doesnot chekc for this but uses jscript comman
which result than in NULL repsponse to the user if he switched o
jscript) than you can use XmlHTTP to communicated with the server.

Of course this is once again a pain with cross browser functionality
so best is you do a jscript class checking which browser calls an
creating the correct object.

See the XmlHttp docs for IE and Mozilla.

Joe Robe
Mel Wrote:
how can i return "HTTP status code 204" from my cgi script ?

any example is appreciated
"Martin Honnen" ma*******@yahoo .de wrote in message
news:42******** *************** @newsread2.arco r-online.net...-
Mel wrote:
-
i would like to have a link, such that when the user clicks on it
a--
script--
is fired to go to server and check for page updates, if any, i
should
request a reload, else stay silend (terminate)

is such thing possible ?-

form action=""
then make the page an ASP or PHP (or whatever you use on the server
and
let it return the HTTP status code 204 if there is no new data,
otherwise send the new data.
--

Martin Honnen
http://JavaScript.FAQTs.com/


--
joer00
Jul 23 '05 #4


Mel wrote:
how can i return "HTTP status code 204" from my cgi script ?


How about looking in the documentation of your favourite CGI
language/package on how to set HTTP response codes?
As you are asking in a JavaScript group I will show you an ASP solution
with JavaScript, if that doesn't help you then use an appropriate group
for your server side language, after checking its documentation and FAQ
list.

<%@ Language="JavaS cript" %>
<%
function checkForUpdates () {
// simply returning a number here
return Math.floor(Math .random() * 10) + 1;
}
var update = checkForUpdates ();
if (update < 5 && Request.ServerV ariables('REQUE ST_METHOD') == 'POST') {
Response.Status = '204 No Content';
Response.End();
}
%>
<html lang="en">
<head>
<title>form updated occasionally</title>
</head>
<body>
<form action="" method="POST">
<div>
<label>
user value:
<input type="text" name="uservalue ">
</label>
<input type="submit" value="check for updates">
</div>
<div>
<span>
updated value:
<%= update %>
</span>
</div>
</form>
</body>
</html>

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
6713
by: Michele | last post by:
Hi all, I have developed a PHP-based website where a "planner" user can make up schedules of activities to be performed, storing them into MySQL tables. Afterwards, other "watcher" users can connect to the website and retrieve closest task due time, and keep retrieving next task after each one has been performed. The problem arises if the planner asynchronously changes the schedule, e.g. deleting the task "watcher" users consider to be...
5
4592
by: Bryan Field-Elliot | last post by:
We're designing a web app in which some operations will take a long time to complete (maybe two minutes). Because it's a high-volume application, we don't want browser connections hanging open for these two-minute intervals; that would cause a huge resource drain on the server (open threads, etc.). We've implemented a page which has a <meta refresh> tag in it of 15 seconds, so that the browser can "check back" with the server every so...
13
14620
by: long5120 | last post by:
I am trying to use webpage with javascript to check if a web server is responding. I was thinking of using 2 frames. Frame1 will have the site, and the Frame2 will be a status bar (not really needed). This webpage will call the site's homepage and refresh in 10 seconds. If I can see the homepage then, the site is up, else site is down. I have an example of my code below. My question, is it possible to check the homepage in frame1 (after...
3
4017
by: Kurita Kinoshita | last post by:
I'm trying to find a way to have a script communicate with a server without having to load a new page. The idea is to have the server act as a simple wrapper for a database, letting the client do that icky UI stuff. I tried the obvious, putting a frame somewhere it doesn't insult the eye, changing its location, then accessing the new content via DOM. What I get from IE (6) for my pains is just a rude "permission denied". This even...
5
2532
by: lucanos | last post by:
Hey Guys, Hoping that you can help me, as I have been scratching my head and getting nothing but dandruff... SITUATION --------- I have a webpage which users will be viewing, which has forms which can be hidden or displayed at the user's choice. The problem is that they want the page to refresh every X seconds, but if it refreshes when a
17
2742
by: Zvi Danovich | last post by:
Hi, I am a newby in ASP.NET, and till now wrote only simple "classic" WEB-sites. But - the time came, and now I need that: 1. Server will "listen" for some events on its local machine 2. According to event received (say - event ID), it will update client pages, that need updating based on this ID (if currently there exist clients that are interesting in specific ID). The good example of such site - airport flight information, when...
10
32888
by: phforum | last post by:
Hi, I wrote a PHP page for user input the information to search the database. And the database data will update every second. I want to set the auto refresh to get the data from database every minute. But the page always display the dialog box ask me to resend the information. How to disable this warning message. I using POST and REQUEST to get the data from user input page. Thanks all
2
1904
by: Max | last post by:
Is it possible to reload a web page on user browser when an event occurs at server side? For example when user A places an order, user B should be notified of that and should see that order on his page. I 'd like to avoid to reload B page every nnn seconds. Or at least, I'd like to check if something interesting has changed on server and only in that case to reload the page. Any suggestion? Thanks Max
5
3754
by: =?Utf-8?B?Sm9obg==?= | last post by:
Hi, I used the following code to refresh the parent page, and it works very well (Thanks to Peter Bromberg "). Response.Write("<script language='javascript' type='text/javascript'{ window.opener.location = 'Default.aspx?Reload=100'; }</script>"); Response.Write("<script language='javascript' type='text/javascript'{ self.close(); }</script>");
0
9703
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10317
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10295
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10069
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9125
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7604
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5501
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3799
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2972
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.