473,322 Members | 1,718 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

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 23511
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.prod igy.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**@CsabaGabor.com> wrote in message
news:bk********@dispatch.concentric.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, getElementByTagTye 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
by: Xerxes | last post by:
Hi, how can I pass the returned value from Javascript to PHP? I have: ------------------------------------------------------------------------ ------ if ( x>y) {
5
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...
1
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...
0
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
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...
4
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...
6
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...
7
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...
3
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.