473,799 Members | 2,940 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Generating Dynamic HTML pages

Hi All,

I am developing a Web based application for an embedded target, using
BOA webserver.

I need to return some values to the HTML client. I am using CGI-C to
extract the values sent by the client from the server.

I dont want to generate the entire HTML page each time from the
server.'cos i need to refresh the status less than a second..

Is there a way for me to pass the Name,Value pairs alone to the HTML
client and using javascript i can assign the value to the HTML client
form.

I appreciate any inputs on this

Thanks
Jul 23 '05 #1
6 2265
Vanitha wrote:
Hi All,

I am developing a Web based application for an embedded target, using
BOA webserver.

I need to return some values to the HTML client. I am using CGI-C to
extract the values sent by the client from the server.

I dont want to generate the entire HTML page each time from the
server.'cos i need to refresh the status less than a second..

Is there a way for me to pass the Name,Value pairs alone to the HTML
client and using javascript i can assign the value to the HTML client
form.

I appreciate any inputs on this

Thanks


Hi,

You could use a hidden frame for this.
It refreshes every 1 sec after loading (maybe using an onLoad function and a
window.setTimeo ut() ).

Make the page in the hidden frame small, so it IS generated dynamically (how
else), but it is just small.
You will need some serverside scripting to accomplish this.

Another approach would be to let the server write a new file that you
reload. COuld be plain HTML-file, but still the server is responsible to
write this file every time some data gets updated.

The file could contain something like this:

suppose this script is called: example1.html

<html>
<head>

<script type="text/javascript">
// this value is written dynamically
var newvalue=42;

// call some function in the frameset definition
parent.newValue Set(newvalue);

// reload this page in 1 second
setTimeout("loc ation='example. html';" , 1000);
</script>

</head>
<body>
empty :-)
</body>
</html>

Regards,
Erwin Moller
Jul 23 '05 #2
va*****@agilis. st.com.sg (Vanitha) wrote:
Hi All,

I am developing a Web based application for an embedded target, using
BOA webserver.

I need to return some values to the HTML client. I am using CGI-C to
extract the values sent by the client from the server.

I dont want to generate the entire HTML page each time from the
server.'cos i need to refresh the status less than a second..

Is there a way for me to pass the Name,Value pairs alone to the HTML
client and using javascript i can assign the value to the HTML client
form.

I appreciate any inputs on this

You could consider using the XML HTTP request object, see:
http://jibbering.com/2002/4/httprequest.html

Jul 23 '05 #3

Erwin Moller wrote:
Vanitha wrote:
Hi All,

I am developing a Web based application for an embedded target, using BOA webserver.

I need to return some values to the HTML client. I am using CGI-C to extract the values sent by the client from the server.

I dont want to generate the entire HTML page each time from the
server.'cos i need to refresh the status less than a second..

Is there a way for me to pass the Name,Value pairs alone to the HTML client and using javascript i can assign the value to the HTML client form.

I appreciate any inputs on this

Thanks
Hi,

You could use a hidden frame for this.
It refreshes every 1 sec after loading (maybe using an onLoad

function and a window.setTimeo ut() ).

Make the page in the hidden frame small, so it IS generated dynamically (how else), but it is just small.
You will need some serverside scripting to accomplish this.

Another approach would be to let the server write a new file that you reload. COuld be plain HTML-file, but still the server is responsible to write this file every time some data gets updated.

The file could contain something like this:

suppose this script is called: example1.html

<html>
<head>

<script type="text/javascript">
// this value is written dynamically
var newvalue=42;

// call some function in the frameset definition
parent.newValue Set(newvalue);

// reload this page in 1 second
setTimeout("loc ation='example. html';" , 1000);
</script>

</head>
<body>
empty :-)
</body>
</html>

Regards,
Erwin Moller


Jul 23 '05 #4
Hi Erwin,

I actually dont want to use the second approach, since the HTML files
are developed by someone
else and i actually need to copy+paste the code to use printf's in my
"C" code to output
html. This is very tedious and i am not getting the images that are
used in the HTML files
Hence i want to use the second approach that you have mentioned, the
hidden frame approach
I actually have created a hidden frame using this code

<FRAMESET COLS="200%,*" framespacing="0 ">
<FRAME SRC="status.htm " NAME="mstatus" SCROLLING=AUTO>
<FRAME SRC="hidden.htm " NAME="hidden" SCROLLING=AUTO>
</FRAMESET>

And when the user clicks some button in status.htm,i am executing this
cgi
window.parent.h idden.location= "http://10.0.0.10/cgi-bin/getstat.cgi
The cgi script is getting executed in the server side, but i dont know
how to send
the response from the server to the client and then how to update that
in the
status.htm file.

can you please let me know how to do the server side scripting. I am
bit
new to javascript, i am basically a "C" programmer.

Jul 23 '05 #5
Hi Erwin,

I actually dont want to use the second approach, since the HTML files
are developed by someone
else and i actually need to copy+paste the code to use printf's in my
"C" code to output
html. This is very tedious and i am not getting the images that are
used in the HTML files
Hence i want to use the second approach that you have mentioned, the
hidden frame approach
I actually have created a hidden frame using this code

<FRAMESET COLS="200%,*" framespacing="0 ">
<FRAME SRC="status.htm " NAME="mstatus" SCROLLING=AUTO>
<FRAME SRC="hidden.htm " NAME="hidden" SCROLLING=AUTO>
</FRAMESET>

And when the user clicks some button in status.htm,i am executing this
cgi
window.parent.h idden.location= "http://10.0.0.10/cgi-bin/getstat.cgi
The cgi script is getting executed in the server side, but i dont know
how to send
the response from the server to the client and then how to update that
in the
status.htm file.

can you please let me know how to do the server side scripting. I am
bit
new to javascript, i am basically a "C" programmer.

Jul 23 '05 #6
va*****@agilis. st.com.sg wrote:
Hi Erwin,

I actually dont want to use the second approach, since the HTML files
are developed by someone
else and i actually need to copy+paste the code to use printf's in my
"C" code to output
html. This is very tedious and i am not getting the images that are
used in the HTML files
Hence i want to use the second approach that you have mentioned, the
hidden frame approach
I actually have created a hidden frame using this code

<FRAMESET COLS="200%,*" framespacing="0 ">
That is strange, you ment probably something like:
<FRAMESET COLS="*,0" framespacing="0 ">

So the hidden frame is invisible (0 pixels)

But this is not important for the functionality. :-)
<FRAME SRC="status.htm " NAME="mstatus" SCROLLING=AUTO>
<FRAME SRC="hidden.htm " NAME="hidden" SCROLLING=AUTO>
</FRAMESET>

And when the user clicks some button in status.htm,i am executing this
cgi
window.parent.h idden.location= "http://10.0.0.10/cgi-bin/getstat.cgi
The cgi script is getting executed in the server side, but i dont know
how to send
the response from the server to the client and then how to update that
in the
status.htm file.

can you please let me know how to do the server side scripting. I am
bit
new to javascript, i am basically a "C" programmer.


Well, what can I do for you?
I can help you a little with the setup, but I cannot give you excact code
because I don't know anything about the project.

I suggest you do the following:
1) Make sure you get some basic Javascript knowledge in.
Pay extra attention to:
a) Communication between different windows.
(Every html in a frame is considered a window.)
eg: parent.frames.h idden etc like you used already
Make sure you can pass basic values from 1 window to the next without any
serverside calls.
eg: To call a function in your frameset, use:
window.parent.s omeFunction();

Of course you need to define a function in your parentframe called that
name:

So to experiment start with this in your parentframe:
<FRAMESET COLS="*,0" framespacing="0 ">
<FRAME SRC="status.htm " NAME="mstatus" SCROLLING=AUTO>
<FRAME SRC="hidden.htm " NAME="hidden" SCROLLING=AUTO>
</FRAMESET>

<script type="text/javascript>
function someFunction(aN umber){
alert ("I received: "+aNumber);
}
</script>
b) Make sure you have a look at the function setTimeout()
You need this to keep polling your server for fresh results.

c) How to manipulate content on a webpage with javascript.

You were talking about forms, so here is an example:

html on a page:
<form action="bla.cgi " name="myForm">
<input type="text" name="age">
<input type="submit">
</form>

Now you can alter the content of the textelement that is named age as
follows:
document.forms["myForm"]["age"].value = 55;

If you want to manipulate existing text on the page instead of forms, ask
somebody else, because I never do that. :P
and 2)
Make sure you rewrite the page that is polled every second by the clients by
first making a simple page.
You can use the one I posted before as a basic template.
You ONLY have to make sure that the process serverside that updates the
information is parsing the right value on the place where I putted the 42.

And a last tip:
http://www.w3schools.com/ is a great place to check up some basic
webconcepts for starters.
http://www.w3schools.com/js/default.asp for example is a crashcourse on
Javascript, but you will find a lot more.

Since you are a C programmer, I think you should be able to master a lot
over there without too much pain. ;-)

Good luck,

Regards,
Erwin Moller
Jul 23 '05 #7

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

Similar topics

14
2604
by: Philippe C. Martin | last post by:
Hi, I wish to use an easy way to generate reports from wxPython and feel wxHtmlEasyPrinting could be a good solution. I now need to generate the HTML wxHtmlEasyPrinting can print: I need to have a title followed by lines of text that do not look too ugly. If possible I would like to use an existing module. Q1) Is there such a module ?
3
4270
by: K.S.Liang | last post by:
Hi all, 1> If there are more than one dynamic linking libraries in the file system, how do I know which one is loaded into system? Any C library or system call can tell me which *.so or *.sl is active? Can the setting of LD_LIBRARY_PATH guanrantee that the correct one is executed? 2> In MS-WINDOWS, once a DLL is loaded by one allication, this DLL will be used by the subsequent appication. Does UNIX have the same
10
3229
by: moondaddy | last post by:
I'm writing an ecommerce app in asp.net/vb.net and need to make the pages searchable and crawlable by spiders, particularly Google's. As far as I know, if my pages's contents are mostly populated by user controls on a single page and I call these different controls by passing one or more parameters like this: myweb.com/default.aspx?MenuID=44, then the spiders aren't going to be able do to anything with this. asp.net offers lots of great...
7
3588
by: Venus | last post by:
Hello, I am trying to generate a dynamic form at runtime and would like to do it using "<asp: ..." form elements as follows Build up the string that is placed somewhere in the HTML code the same way like regular input fields can. strForm = "<form name=""myForm"" runat=""server"">" & vbCrLf strForm += "<asp:button name=""myName"" .... runat=""server"" />" & vbCrLf
2
1350
by: cnickl | last post by:
I’m using the usual VisualStudio setup. That is to have a “Code Behind” (somename.aspx.vb) file with all the code and the actual HTML code somename.aspx) separate. I like this setup, but now I want to generate some text and HTML code output using VB code and I want it to be placed in the <body> part of my somename.aspx. If I use the Response.Write() method the text is put in the beginning of the file. How can I generate text and HTML...
8
2259
by: Sandy Pittendrigh | last post by:
I have a how-to-do-it manual like site, related to fishing. I want to add a new interactive question/comment feature to each instructional page on the site. I want (registered) users to be able to add comments at the bottom of each page, similar to the way the php, mysql, apache manuals work. PUNCHLINE_A:
10
2166
by: maxvalery | last post by:
Because dynamic pages do not get indexed well in search engines, is there a decent API out there to parse through the site and write pages as plain html automatically? I noticed some WordPress and Blogger writers have their posts served up as plain html. Any ideas? Thanks.
5
3177
by: pittendrigh | last post by:
There must be millions of dynamically generated html pages out there now, built by on-the-fly php code (and jsp, perl cgi, asp, etc). Programatic page generation is transparently useful. But querying a database, negotiatinig lots of if-then-else logic and echo'ing html code out on port 80 every time a page is requested has to be a huge waste of resources. Why not use that logic to print static html instead of dynamic?
9
2986
by: pbd22 | last post by:
Hi. This is just a disaster management question. I am using XMLHTTP for the dynamic loading of content in a very crucial area of my web site. Same as an IFrame, but using XMLHTTP and a DIV. I got the core of the javascript from here: http://www.dynamicdrive.com/dynamicindex17/ajaxcontent.htm I noticed in the demo that sometimes the content takes a long
0
9687
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, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
9541
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10251
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
10225
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
5463
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
5585
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4139
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
2
3759
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2938
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.