473,397 Members | 1,960 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,397 software developers and data experts.

force to refresh browser

Jay
I'm trying to refresh browser when some new information is available in DB.
is there any way to force to refresh browser?
Thanks.

-Kev

Jul 20 '05 #1
19 36505
In article <bp**********@msunews.cl.msu.edu>, no@spam.com enlightened us
with...
I'm trying to refresh browser when some new information is available in DB.
is there any way to force to refresh browser?
Thanks.

window.location.reload(true);

Beware infinite refresh if not in a function!

--
~kaeli~
Is it possible to be totally partial?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 20 '05 #2
Jay
Thanks!

well, window.location.reload(true) does whenever control is hit that line,
it does refresh.
What I want to do is server side trigger send message to client browser to
refresh it.

-Kev

"kaeli" <ti******@NOSPAM.comcast.net> wrote in message
news:MP************************@nntp.lucent.com...
In article <bp**********@msunews.cl.msu.edu>, no@spam.com enlightened us
with...
I'm trying to refresh browser when some new information is available in DB. is there any way to force to refresh browser?
Thanks.

window.location.reload(true);

Beware infinite refresh if not in a function!

--
~kaeli~
Is it possible to be totally partial?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 20 '05 #3
In article <bp**********@msunews.cl.msu.edu>, no@spam.com enlightened us
with...
Thanks!

well, window.location.reload(true) does whenever control is hit that line,
it does refresh.
What I want to do is server side trigger send message to client browser to
refresh it.


Technically, you can't in a normal cross-browser internet environment
(that is, activeX, applets, and COM notwithstanding).

If the page should be refreshed every so often, put it in a setTimeout.
This is common.

If the user updates the DB via a popup with the main window on a
particular page you want to refresh, write a script as output to the
popup that calls window.opener.location.reload(true).

Other situation, please elaborate. We can probably find something that
works for you.

--
~kaeli~
A backward poet writes... inverse.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 20 '05 #4
Jay
Thank you for your help.
I'm displaying hotel information from DB.

What I want to is
First, I will get the hotel list and display with no rate. ( since getting
rate takes time)
Whenever rate information is ready to update. refresh user's browser.

but how?

Thanks.
-Kev

"kaeli" <ti******@NOSPAM.comcast.net> wrote in message
news:MP************************@nntp.lucent.com...
In article <bp**********@msunews.cl.msu.edu>, no@spam.com enlightened us
with...
Thanks!

well, window.location.reload(true) does whenever control is hit that line, it does refresh.
What I want to do is server side trigger send message to client browser to refresh it.


Technically, you can't in a normal cross-browser internet environment
(that is, activeX, applets, and COM notwithstanding).

If the page should be refreshed every so often, put it in a setTimeout.
This is common.

If the user updates the DB via a popup with the main window on a
particular page you want to refresh, write a script as output to the
popup that calls window.opener.location.reload(true).

Other situation, please elaborate. We can probably find something that
works for you.

--
~kaeli~
A backward poet writes... inverse.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 20 '05 #5
In article <bp**********@msunews.cl.msu.edu>, no@spam.com enlightened us
with...
Thank you for your help.
I'm displaying hotel information from DB.

What I want to is
First, I will get the hotel list and display with no rate. ( since getting
rate takes time)
Whenever rate information is ready to update. refresh user's browser.

but how?


If you are getting the hotel list from the DB, getting the rate should
take an inconsequential amount of time, especially if the DB is set up
properly and a concise SQL statement is used. Views can be helpful for
this if the rate is a calculated field or is keyed by a number rather
than a hotel name.
Rates do not change often enough to need to refresh the user's browser
more than with a setTimeout for some amount of time.
Perhaps what you really need is help with your SQL query.

If you're not getting the hotel list from the DB, why not? That is much
easier than manually changing pages. :)
The DB must have the hotels in there or it would be impossible to look
up rates.

How I would do this: query the DB for the list of hotels and rates and
write the whole thing dynamically at once. I do much more complicated
things with billing data for one of my pages and it takes less than 10
seconds to run and load.

--
~kaeli~
Not one shred of evidence supports the notion that life is
serious.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 20 '05 #6
Jay
Thanks.

I did not explained in detail so I can avoid some confusions.
But I guess it did more harm than good.

Hotel list are coming from our DB and rate are coming from GDS in XML.
I have a java object created with list first and displays and trying to
update as soon as I got XML response.

XML response is quite slow. ( you know there is nothing I can do).
I can wait XML and display all together. but I'm just seeking a way to
display list of hotel first with some animation indicating
rate is being updated and display rate when it's available.

is that make sense now?

-Kev


"kaeli" <ti******@NOSPAM.comcast.net> wrote in message
news:MP************************@nntp.lucent.com...
In article <bp**********@msunews.cl.msu.edu>, no@spam.com enlightened us
with...
Thank you for your help.
I'm displaying hotel information from DB.

What I want to is
First, I will get the hotel list and display with no rate. ( since getting rate takes time)
Whenever rate information is ready to update. refresh user's browser.

but how?


If you are getting the hotel list from the DB, getting the rate should
take an inconsequential amount of time, especially if the DB is set up
properly and a concise SQL statement is used. Views can be helpful for
this if the rate is a calculated field or is keyed by a number rather
than a hotel name.
Rates do not change often enough to need to refresh the user's browser
more than with a setTimeout for some amount of time.
Perhaps what you really need is help with your SQL query.

If you're not getting the hotel list from the DB, why not? That is much
easier than manually changing pages. :)
The DB must have the hotels in there or it would be impossible to look
up rates.

How I would do this: query the DB for the list of hotels and rates and
write the whole thing dynamically at once. I do much more complicated
things with billing data for one of my pages and it takes less than 10
seconds to run and load.

--
~kaeli~
Not one shred of evidence supports the notion that life is
serious.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 20 '05 #7
In article <bp***********@msunews.cl.msu.edu>, no@spam.com enlightened
us with...
I did not explained in detail so I can avoid some confusions.
But I guess it did more harm than good.

Hotel list are coming from our DB and rate are coming from GDS in XML.
I have a java object created with list first and displays and trying to
update as soon as I got XML response.

XML response is quite slow. ( you know there is nothing I can do).
I can wait XML and display all together. but I'm just seeking a way to
display list of hotel first with some animation indicating
rate is being updated and display rate when it's available.

is that make sense now?


Yes, much.

Okay, there really isn't a good way that I know of (cross-browser) to do
this. If you're using IE only (intranet application) let me know,
because you have more options. Generally speaking, once the page is
written, the server knows nothing else about it. It can't refresh the
browser, because the connection is over. COM and ActiveX are exceptions,
but are IE only (AFAIK).

Anyway, the way I would handle this is with an "invisible" iframe
(styled to hidden or 1px by 1px the same background color as the main
page). I would have the iframe wait for the XML, then when it is
received, update the encompassing page. This doesn't require a refresh,
just DHTML.
That still requires NN6+/IE5+ and other browsers that support
iframes/DHTML, but it's better than IE only. Last I checked at my site,
95% of my viewers had browsers that were IE5+ or compatible (opera can
spoof this so be careful).

Do your target users have updated browsers? Do they have permissions to
update their browsers if they need to (i.e. people at schools and
libraries do not.)?

I'm sure there are other ways to handle this, such as applets, COM,
ActiveX, etc, but all require knowing quite a bit about your users'
browsers. For example, using an applet is a bad idea if your users
access the site from public facilities, since they don't have permission
to install an updated JVM should they need to.

--
~kaeli~
A plateau is a high form of flattery.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 20 '05 #8
Jay
do you have any iframe sample I can look?
or please direct me to web site I can get some info from.
Thanks again.

-Kev
"kaeli" <ti******@NOSPAM.comcast.net> wrote in message
news:MP************************@nntp.lucent.com...
In article <bp***********@msunews.cl.msu.edu>, no@spam.com enlightened
us with...
I did not explained in detail so I can avoid some confusions.
But I guess it did more harm than good.

Hotel list are coming from our DB and rate are coming from GDS in XML.
I have a java object created with list first and displays and trying to
update as soon as I got XML response.

XML response is quite slow. ( you know there is nothing I can do).
I can wait XML and display all together. but I'm just seeking a way to
display list of hotel first with some animation indicating
rate is being updated and display rate when it's available.

is that make sense now?


Yes, much.

Okay, there really isn't a good way that I know of (cross-browser) to do
this. If you're using IE only (intranet application) let me know,
because you have more options. Generally speaking, once the page is
written, the server knows nothing else about it. It can't refresh the
browser, because the connection is over. COM and ActiveX are exceptions,
but are IE only (AFAIK).

Anyway, the way I would handle this is with an "invisible" iframe
(styled to hidden or 1px by 1px the same background color as the main
page). I would have the iframe wait for the XML, then when it is
received, update the encompassing page. This doesn't require a refresh,
just DHTML.
That still requires NN6+/IE5+ and other browsers that support
iframes/DHTML, but it's better than IE only. Last I checked at my site,
95% of my viewers had browsers that were IE5+ or compatible (opera can
spoof this so be careful).

Do your target users have updated browsers? Do they have permissions to
update their browsers if they need to (i.e. people at schools and
libraries do not.)?

I'm sure there are other ways to handle this, such as applets, COM,
ActiveX, etc, but all require knowing quite a bit about your users'
browsers. For example, using an applet is a bad idea if your users
access the site from public facilities, since they don't have permission
to install an updated JVM should they need to.

--
~kaeli~
A plateau is a high form of flattery.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 20 '05 #9
In article <bp***********@msunews.cl.msu.edu>, no@spam.com enlightened
us with...
do you have any iframe sample I can look?
or please direct me to web site I can get some info from.
Thanks again.


Tested in NN7.1 and IE6.0 successfully.

test1.htm
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<p>This is a test page with an iframe that fills in the form below.</p>
<form name="form1" method="post" action="">
<p>item 1:&nbsp;&nbsp;
<input name="item1" type="text" id="item1">
</p>
<p>item 2:&nbsp;&nbsp;
<input name="item2" type="text" id="item2">
</p>
<p>item 3:&nbsp;&nbsp;
<input name="item3" type="text" id="item3">
</p>
</form>
<iframe height="1px" width="1px" src="test2.htm" style="top:-
50;position:absolute;"></iframe>
</body>
</html>
test2.htm
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
This is the contents of the iframe for test1.html
<script type="text/javascript">
top.document.form1.item1.value="hi there";
top.document.form1.item2.value="this is from an iframe";
top.document.form1.item3.value="boo!";

</script>
</body>
</html>

--
~kaeli~
Dijon vu - the same mustard as before.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 20 '05 #10
Jay
Thanks, Kaeli,

I see how iframe works.
However, I do not understand how ifram helps my situation.

Do I constantly refresh test1.htm?

-kev

"kaeli" <ti******@NOSPAM.comcast.net> wrote in message
news:MP************************@nntp.lucent.com...
In article <bp***********@msunews.cl.msu.edu>, no@spam.com enlightened
us with...
do you have any iframe sample I can look?
or please direct me to web site I can get some info from.
Thanks again.


Tested in NN7.1 and IE6.0 successfully.

test1.htm
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<p>This is a test page with an iframe that fills in the form below.</p>
<form name="form1" method="post" action="">
<p>item 1:&nbsp;&nbsp;
<input name="item1" type="text" id="item1">
</p>
<p>item 2:&nbsp;&nbsp;
<input name="item2" type="text" id="item2">
</p>
<p>item 3:&nbsp;&nbsp;
<input name="item3" type="text" id="item3">
</p>
</form>
<iframe height="1px" width="1px" src="test2.htm" style="top:-
50;position:absolute;"></iframe>
</body>
</html>
test2.htm
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
This is the contents of the iframe for test1.html
<script type="text/javascript">
top.document.form1.item1.value="hi there";
top.document.form1.item2.value="this is from an iframe";
top.document.form1.item3.value="boo!";

</script>
</body>
</html>

--
~kaeli~
Dijon vu - the same mustard as before.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 20 '05 #11
Jay
Anyway, the way I would handle this is with an "invisible" iframe
(styled to hidden or 1px by 1px the same background color as the main
page). I would have the iframe wait for the XML, then when it is
received, update the encompassing page. This doesn't require a refresh,
just DHTML.
"update the encompassing page" I don't know how to do that..

Thanks.

"Jay" <no@spam.com> wrote in message
news:bp***********@msunews.cl.msu.edu...
Thanks, Kaeli,

I see how iframe works.
However, I do not understand how ifram helps my situation.

Do I constantly refresh test1.htm?

-kev

"kaeli" <ti******@NOSPAM.comcast.net> wrote in message
news:MP************************@nntp.lucent.com...
In article <bp***********@msunews.cl.msu.edu>, no@spam.com enlightened
us with...
do you have any iframe sample I can look?
or please direct me to web site I can get some info from.
Thanks again.


Tested in NN7.1 and IE6.0 successfully.

test1.htm
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<p>This is a test page with an iframe that fills in the form below.</p>
<form name="form1" method="post" action="">
<p>item 1:&nbsp;&nbsp;
<input name="item1" type="text" id="item1">
</p>
<p>item 2:&nbsp;&nbsp;
<input name="item2" type="text" id="item2">
</p>
<p>item 3:&nbsp;&nbsp;
<input name="item3" type="text" id="item3">
</p>
</form>
<iframe height="1px" width="1px" src="test2.htm" style="top:-
50;position:absolute;"></iframe>
</body>
</html>
test2.htm
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
This is the contents of the iframe for test1.html
<script type="text/javascript">
top.document.form1.item1.value="hi there";
top.document.form1.item2.value="this is from an iframe";
top.document.form1.item3.value="boo!";

</script>
</body>
</html>

--
~kaeli~
Dijon vu - the same mustard as before.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace


Jul 20 '05 #12
In article <bp***********@msunews.cl.msu.edu>, no@spam.com enlightened
us with...
Anyway, the way I would handle this is with an "invisible" iframe
(styled to hidden or 1px by 1px the same background color as the main
page). I would have the iframe wait for the XML, then when it is
received, update the encompassing page. This doesn't require a refresh,
just DHTML.
"update the encompassing page" I don't know how to do that..


The pages I gave you show that. test2 updates test1. I used a form for
ease and quickness, but you could do any block-level element.

What you do is have the query / xml run in what was my test2.htm. When
it loads, the xml is done. When it loads, have the script write to what
was my test1.htm.
--
~kaeli~
The man who fell into an upholstery machine is fully
recovered.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 20 '05 #13
Jay
then Until test2 is fully updated user is not seeing test1?

Well, my task is while user watching test1.
updates test2 and when update test2 is done refresh test1.
so user can see updated info.

is user has to wait test2 is updated and while doing updating, user don't
see any info.
It is kinda same as before.

"kaeli" <ti******@NOSPAM.comcast.net> wrote in message
news:MP************************@nntp.lucent.com...
In article <bp***********@msunews.cl.msu.edu>, no@spam.com enlightened
us with...
Anyway, the way I would handle this is with an "invisible" iframe
(styled to hidden or 1px by 1px the same background color as the main
page). I would have the iframe wait for the XML, then when it is
received, update the encompassing page. This doesn't require a refresh,
just DHTML.
"update the encompassing page" I don't know how to do that..


The pages I gave you show that. test2 updates test1. I used a form for
ease and quickness, but you could do any block-level element.

What you do is have the query / xml run in what was my test2.htm. When
it loads, the xml is done. When it loads, have the script write to what
was my test1.htm.
--
~kaeli~
The man who fell into an upholstery machine is fully
recovered.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 20 '05 #14
In article <bp***********@msunews.cl.msu.edu>, no@spam.com enlightened
us with...
then Until test2 is fully updated user is not seeing test1?


No, they see it.

That's the point of the iframe.

--
~kaeli~
Murphy's Law #3020: Quality assurance doesn't.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 20 '05 #15
Jay
I tried with test1 and test2.
What I did was while I'm watching test1.htm.

modify values in test2 and save.
test1.htm.values in text box is not changed.
Unless I refresh test.htm.

Could I force to refresh test1.htm from test2?
Thanks alot.

"kaeli" <ti******@NOSPAM.comcast.net> wrote in message
news:MP************************@nntp.lucent.com...
In article <bp***********@msunews.cl.msu.edu>, no@spam.com enlightened
us with...
then Until test2 is fully updated user is not seeing test1?


No, they see it.

That's the point of the iframe.

--
~kaeli~
Murphy's Law #3020: Quality assurance doesn't.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 20 '05 #16
In article <bp***********@msunews.cl.msu.edu>, no@spam.com enlightened
us with...
I tried with test1 and test2.
What I did was while I'm watching test1.htm.

modify values in test2 and save. test1.htm.values in text box is not changed.
Unless I refresh test.htm.

Could I force to refresh test1.htm from test2?


Yes, but you're doing someting wrong if the write didn't show in test1.
Test2 is dynamic in practice - the values are assumed to be gotten from
XML or some other server-side language. The hardcoded values are for
testing only, to show you it could be done. You'd need to refresh only
if you changed hardcoded values (hardcoded values would defeat the
entire purpose of this exercise). When you make it dynamic, you don't
have to refresh.

I don't use xml or I'd give you an example.
I can give you an example with ASP or JSP...?

--
~kaeli~
You feel stuck with your debt if you can't budge it.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 20 '05 #17
Jay
JSP would be great.
Thanks.
"kaeli" <ti******@NOSPAM.comcast.net> wrote in message
news:MP************************@nntp.lucent.com...
In article <bp***********@msunews.cl.msu.edu>, no@spam.com enlightened
us with...
I tried with test1 and test2.
What I did was while I'm watching test1.htm.

modify values in test2 and save.

test1.htm.values in text box is not changed.
Unless I refresh test.htm.

Could I force to refresh test1.htm from test2?


Yes, but you're doing someting wrong if the write didn't show in test1.
Test2 is dynamic in practice - the values are assumed to be gotten from
XML or some other server-side language. The hardcoded values are for
testing only, to show you it could be done. You'd need to refresh only
if you changed hardcoded values (hardcoded values would defeat the
entire purpose of this exercise). When you make it dynamic, you don't
have to refresh.

I don't use xml or I'd give you an example.
I can give you an example with ASP or JSP...?

--
~kaeli~
You feel stuck with your debt if you can't budge it.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 20 '05 #18
In article <bp***********@msunews.cl.msu.edu>, no@spam.com enlightened
us with...
JSP would be great.
Thanks.


Okay, this is tested successfully in NN6+ only.
test1.jsp has a table with just a header.
test2.jsp queries a DB, then writes the results to the table in
test1.jsp.

When the user brings up test1, they see only the table headers until the
query from test2 is completed. When the query is done, the page loads
and fills in test1's table.

test1.jsp
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<p>This is a test page with an iframe that fills in the table below.</p>
<table width="75%" border="1" cellspacing="1" cellpadding="5">
<tbody id="cTbl">
<tr>
<td width="10%" nowrap>Customer Id</td>
<td width="90%" nowrap>Customer Name</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<iframe height="1px" width="1px" src="test2.jsp" style="top:-
50;position:absolute;"></iframe>
</body>
</html>
test2.jsp
<%@ page import="OPS.*" %>
<%@ page import="java.sql.*" %>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
This is the contents of the iframe for test1.jsp
<%
String q;
String userName="";
String psswd="";
ResultSet rs;
int x = 0; // keep row count
// connect to the database
OPS_dbInteract opsConn = new OPS_dbInteract();
opsConn.connect();
q = "select unique customerName, UPPER(customerName) as CN, customerId
" +
"from customerTbl where customerName like 'A%' "+
"order by CN";
rs = opsConn.queryDB(q);
// for each customer, fill table in test1.jsp
while (rs != null && rs.next())
{
x++; //row count
%>
<script type="text/javascript">
TR = document.createElement("TR");
TD = document.createElement("TD");
txt = document.createTextNode("<%= rs.getLong("customerId") %>");
TD.appendChild(txt);
TR.appendChild(TD);
TD = document.createElement("TD");
txt = document.createTextNode("<%= rs.getString("customerName")
%>");
TD.appendChild(txt);
TR.appendChild(TD);
top.document.getElementById("cTbl").appendChild(TR );
</script>
<%
}
opsConn.close();
%>

</body>
</html>


--
~kaeli~
Does the name Pavlov ring a bell?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 20 '05 #19
Jay
Thanks, You are a life saver.
I will let you know after testing.

-kev

"kaeli" <ti******@NOSPAM.comcast.net> wrote in message
news:MP************************@nntp.lucent.com...
In article <bp***********@msunews.cl.msu.edu>, no@spam.com enlightened
us with...
JSP would be great.
Thanks.


Okay, this is tested successfully in NN6+ only.
test1.jsp has a table with just a header.
test2.jsp queries a DB, then writes the results to the table in
test1.jsp.

When the user brings up test1, they see only the table headers until the
query from test2 is completed. When the query is done, the page loads
and fills in test1's table.

test1.jsp
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<p>This is a test page with an iframe that fills in the table below.</p>
<table width="75%" border="1" cellspacing="1" cellpadding="5">
<tbody id="cTbl">
<tr>
<td width="10%" nowrap>Customer Id</td>
<td width="90%" nowrap>Customer Name</td>
</tr>
</tbody>
</table>
<p>&nbsp;</p>
<iframe height="1px" width="1px" src="test2.jsp" style="top:-
50;position:absolute;"></iframe>
</body>
</html>
test2.jsp
<%@ page import="OPS.*" %>
<%@ page import="java.sql.*" %>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
This is the contents of the iframe for test1.jsp
<%
String q;
String userName="";
String psswd="";
ResultSet rs;
int x = 0; // keep row count
// connect to the database
OPS_dbInteract opsConn = new OPS_dbInteract();
opsConn.connect();
q = "select unique customerName, UPPER(customerName) as CN, customerId
" +
"from customerTbl where customerName like 'A%' "+
"order by CN";
rs = opsConn.queryDB(q);
// for each customer, fill table in test1.jsp
while (rs != null && rs.next())
{
x++; //row count
%>
<script type="text/javascript">
TR = document.createElement("TR");
TD = document.createElement("TD");
txt = document.createTextNode("<%= rs.getLong("customerId") %>");
TD.appendChild(txt);
TR.appendChild(TD);
TD = document.createElement("TD");
txt = document.createTextNode("<%= rs.getString("customerName")
%>");
TD.appendChild(txt);
TR.appendChild(TD);
top.document.getElementById("cTbl").appendChild(TR );
</script>
<%
}
opsConn.close();
%>

</body>
</html>


--
~kaeli~
Does the name Pavlov ring a bell?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 20 '05 #20

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

Similar topics

1
by: Charles Soto | last post by:
I've got a main loop script that calls two other scripts that do no user interaction. All they do is send a couple of mysql update statements. Then they use header() to call the main loop again. ...
2
by: thenetflyer | last post by:
<!-- The following sample should authorize the user to log on the site. This works once but after refreshing the browser, it does not prompt again for login until all browser (IE 6) windows are...
4
by: Martin | last post by:
This is probably more of an HTML question than PHP. Perhaps someone here can answer or point me to a proper newsgroup. How can I force the browser to reload an image from the server? I have a...
1
by: Marco Maroni | last post by:
How to force image refresh on client browser ? Is ti possible to force the refresh of the same image (tha was changed server-side) to the client, without user press Contrl+F5 in IE ? - Marco
2
by: qqq | last post by:
I need a page to be refreshed, even if the user navigates back to it with the 'Back' button in the browser. I've put "Reponse.expires=0" in the Page_load event, but the desired refresh isn't...
5
by: Selden McCabe | last post by:
I have a page that displays a picture. In the page load I figure out which image and then do a StudentPicutre.imageurl = <some file name> But if you use the browser's back button, enter...
10
by: Fred Nelson | last post by:
Hi: I have a VB.NET web application and I need to find a way to cause a page refresh from within my application. Does anyone know how to force the browser to refresh the current page? ...
4
by: Paul Drummond | last post by:
Is there a way to force a page refresh, so users will not receive a cached version of a page, even if they have their browser set to never check for a newer version of page? Thank you!
41
by: Twayne | last post by:
Hi, How would I go about "forcing" a user from one page to another? I have a very simple random question/answer entrance requirement for an e-mail form. After 3 page views most people are...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
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...
0
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,...
0
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...

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.