473,761 Members | 10,280 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can javascript POST without refresh?

Hello-

I have a website that uses a custom built webserver to serve the pages.
(Please don't ask me why my boss had his own web server written). I am
displaying a log of information that is an unknown number of rows. This is
currently displayed in a table.

The table is generated by some code that we had to write (thank you custom
webserver) so that the webserver will parse HTML files and fill in the tags
we created with some data before returning that to the browser, the HTML
looks a lot like ASP or JSP using the <% %> tags to denote something to be
filled in.

Now all that works fine and dandy, but in order for this log of information
to show the latest stuff, the page needs to refresh and tell the server to
go get the list of log info and fill in the HTML with the info then return
it to the browser. All this happens pretty quick, but like any site, the
page blinks while it refreshes.

Now my boss wants that page to update without refreshing (the blink annoys
him apparently). At first I said that it couldn't be done, but he said that
he didn't believe me. Thus I am forced to ask you guys.

I know you can update fields like that using JavaScript. (I made a font tag
with an id and a JavaScript function resets the nodeValue. This changes the
text without refreshing the screen). But my problem now is that I need to
POST to the server to get the information without the page refreshing
(through JavaScript?). Is this even possible? I planned on getting the
data back and document.write( ) it all to the page.

Any ideas?

Post note: He saw his router's webpage dynamically update in this fashion.
Jul 20 '05 #1
3 23542
Your boss is correct, though it will take some care
to do properly. You can get some ideas from
http://groups.google.com/groups?th=eb5f407da2a4bf5
and
http://groups.google.com/groups?th=32712214ea820f6d

Csaba Gabor from New York

Please post back what route you use if you get it working
nicely. I'd be especially curious to know if you can use the
cookie route (though I would probably use an IFRAME
in your place).

"Troy" <tr**@morpheus. No_SpAm.net> wrote in message news:xF******** *************** @newssvr12.news .prodigy.com...
Hello-

I have a website that uses a custom built webserver to serve the pages.
(Please don't ask me why my boss had his own web server written). I am
displaying a log of information that is an unknown number of rows. This is
currently displayed in a table.

The table is generated by some code that we had to write (thank you custom
webserver) so that the webserver will parse HTML files and fill in the tags
we created with some data before returning that to the browser, the HTML
looks a lot like ASP or JSP using the <% %> tags to denote something to be
filled in.

Now all that works fine and dandy, but in order for this log of information
to show the latest stuff, the page needs to refresh and tell the server to
go get the list of log info and fill in the HTML with the info then return
it to the browser. All this happens pretty quick, but like any site, the
page blinks while it refreshes.

Now my boss wants that page to update without refreshing (the blink annoys
him apparently). At first I said that it couldn't be done, but he said that
he didn't believe me. Thus I am forced to ask you guys.

I know you can update fields like that using JavaScript. (I made a font tag
with an id and a JavaScript function resets the nodeValue. This changes the
text without refreshing the screen). But my problem now is that I need to
POST to the server to get the information without the page refreshing
(through JavaScript?). Is this even possible? I planned on getting the
data back and document.write( ) it all to the page.

Any ideas?

Post note: He saw his router's webpage dynamically update in this fashion.


Jul 20 '05 #2
Troy wrote:
Hello-

[...snip...]
Now all that works fine and dandy, but in order for this log of information
to show the latest stuff, the page needs to refresh and tell the server to
go get the list of log info and fill in the HTML with the info then return
it to the browser. All this happens pretty quick, but like any site, the
page blinks while it refreshes.

Now my boss wants that page to update without refreshing (the blink annoys
him apparently). At first I said that it couldn't be done, but he said that
he didn't believe me. Thus I am forced to ask you guys.

I know you can update fields like that using JavaScript. (I made a font tag
with an id and a JavaScript function resets the nodeValue. This changes the
text without refreshing the screen). But my problem now is that I need to
POST to the server to get the information without the page refreshing
(through JavaScript?). Is this even possible? I planned on getting the
data back and document.write( ) it all to the page.

Wouldn't use document.write( )...

Take a look at
http://devedge.netscape.com/viewsour...nner-browsing/

or
http://jibbering.com/2002/4/httprequest.html

Any ideas?

Post note: He saw his router's webpage dynamically update in this fashion.


Do view-source when looking at the router's webpage to see how that does it.

Good luck!
Stephen

Jul 20 '05 #3
"Csaba2000" <ne**@CsabaGabo r.com> wrote in message
news:bk******** @dispatch.conce ntric.net...
(snip)
Please post back what route you use if you get it working
nicely. I'd be especially curious to know if you can use the
cookie route (though I would probably use an IFRAME
in your place).


Hi!

Sorry it took so long for me to post back but I used the IFRAME method in
the links you gave me. Thanks!

Here's what I did. I created an IFRAME which hit's the server and gets the
data. Then I used our homemade parser (i.e. ASP or JSP) to dynamically
create a javascript 2D array of the data that will be displayed in a table
later. That array is sent to the parent's write_table function when the
IFRAME's onload event occurs.

The parent receives this array and uses the DOM functionality
(createElement, getElementByTag Tye etc) to dynamically create a table and
set the table attributes. This effectively let's the refresh happen in the
background and the table is updated immediately without any flashing or
blinking of any kind.

Then, I got fancy and removed all the javascript from the main html file and
loaded them from .js files because I will be using these a lot. No problem
with mozilla/netscape, but IE stopped working. See my other post in this
newsgroup about that problem. I have no idea how to solve it.

But thanks for your help, it is greatly appreciated!

troy
Jul 20 '05 #4

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

Similar topics

2
3531
by: Xerxes | last post by:
Hi, how can I pass the returned value from Javascript to PHP? I have: ------------------------------------------------------------------------ ------ if ( x>y) {
5
4456
by: Steve | last post by:
Hi, I have a private website for 20 people that is similar to a web email client like hotmail. There are two frames, one on the left with links for "New", "History", "Todays" and a frame on the right with a table for viewing the contents of these messages. The left pane checks back with the server every few seconds to see if any new messages need to be processed and updates count accordingly.
1
34320
by: Lew | last post by:
Hi all, I'm trying to create a page that has a user-selectable page auto-refresh option (IE 5.5). Essentially, it's a page that contains a checkbox, when the user checks the checkbox, I'd like the page to auto-refresh every 4 seconds....if the user un-checks the checkbox, I'd like to turn off the auto refresh. The page is as follows:
0
3403
by: Juan Jose Costello Levien | last post by:
Hello, My name is Juan. I am new to the forum. Here I leave you a problem to see if you can help me. General Description I am developing an application in Visual Basic 6.
1
3259
by: IkBenHet | last post by:
Hello, Currently I am using a large input form on a website that is based on ASP and JavaScript. Depending on the values that are filled in by the user the forms does a refresh and makes other input fields available to fill in. I use the JavaScript OnChange function (=clientside) that creates a querystring and does a refresh of the page. It works fine.
4
4587
by: Matt Jensen | last post by:
Howdy all Hopefully I can explain my problem straightforwardly. In it's simplest explanation, what I want to do is have a hyperlink that, when clicked, executes some client side JavaScript and then saves every form element value and reloads the page (with the 'save' being much the same as what is achieved by an AutoPostBack="True" attribute on a web/html control). Actually it doesn't matter which order the JavaScript or 'save'...
6
3700
by: Vear | last post by:
Hi, I have a web page that is in a master page. The user fills in the page and at the bottom I have a link for terms which when they click is causing post back. Here is the code. Is there a way to just have the popup without the postback? this is in ASP.NET 2.0 HyperLink ID="HyperLink2" runat="server" NavigateUrl="javascript:location=location;window.open('iTerms.aspx','NMO','height=400,width=400,scrollbars=Yes,resizable=Yes')"...
7
2821
by: Assimalyst | last post by:
Hi, I want to create a popup to notify a user that the server side process has completed successfully. I intended to use a javascript alert to do this, although ideally the icon should be different, but thats another story . . . Anyway, on successful completion of the process i use this piece of code:
3
4122
by: Christina | last post by:
Hello !! I want a link on my vb.net web application, which when clicked, popUp's up and shows a msg. AFAIK, Javascript is the best way to go. So I created an asp:hyperlink, and on its 'on click' event, I have something like: Page.RegisterStartupScript("myWinName", showAPopUp(messageString), where, showAPopUp is a code-behind function which has
0
9531
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...
1
9905
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
9775
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
8780
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...
0
5229
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...
0
5373
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3881
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3456
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2752
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.