473,396 Members | 2,158 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,396 software developers and data experts.

Avoid sending GIF files, while dynamically generating HTML pages

Hi All,

I need to constantly update some values to the User Interface. In order
to do the updation efficiently, i am planning to run some script in the
server side that constantly keeps sending the values alone to the User
Interface client. But i need to send some GIF files as well to change
the colour of the block diagram. something like send a green arrow when
the equipment is UP and red arrow gif file when its down.

How can i avoid sending the GIF files, continuously to client ? Is it
possible for me to have one single GIF file, so that i can modify the
colour of the gif file with some option ?

Thanks
Vanitha

Sep 14 '05 #1
5 1739
I need to constantly update some values to the User Interface. In order
to do the updation efficiently, i am planning to run some script in the
server side that constantly keeps sending the values alone to the User
Interface client.
how do you intend to get this to work ? how will your server update the
clients UI ?
But i need to send some GIF files as well to change
the colour of the block diagram. something like send a green arrow when
the equipment is UP and red arrow gif file when its down.

How can i avoid sending the GIF files, continuously to client ? Is it
possible for me to have one single GIF file, so that i can modify the
colour of the gif file with some option ?


just preload all the gifs that you will need and then swap them when the
conditions are met.
Sep 14 '05 #2
Hi Vanitha,
What ever you are trying to say is not very clear. If you post some
code along with your question it will be helpful for us to help you.

-- Peroli Sivaprakasam

va*********@gmail.com wrote:
Hi All,

I need to constantly update some values to the User Interface. In order
to do the updation efficiently, i am planning to run some script in the
server side that constantly keeps sending the values alone to the User
Interface client. But i need to send some GIF files as well to change
the colour of the block diagram. something like send a green arrow when
the equipment is UP and red arrow gif file when its down.

How can i avoid sending the GIF files, continuously to client ? Is it
possible for me to have one single GIF file, so that i can modify the
colour of the gif file with some option ?

Thanks
Vanitha


Sep 14 '05 #3
va*********@gmail.com wrote:
Hi All,

I need to constantly update some values to the User Interface. In order
to do the updation efficiently, i am planning to run some script in the
server side that constantly keeps sending the values alone to the User
Interface client. But i need to send some GIF files as well to change
the colour of the block diagram. something like send a green arrow when
the equipment is UP and red arrow gif file when its down.

How can i avoid sending the GIF files, continuously to client ? Is it
possible for me to have one single GIF file, so that i can modify the
colour of the gif file with some option ?


You could load the two images, say have the redArrow visible by
default and the green not visible. Then toggle their style.display
values, something like:

...
var isUp = testEquipment();
greenArrow.style.display = ( isUp )? '' : 'none';
redArrow.style.display = ( isUp )? 'none' : '';
...


--
Rob
Sep 14 '05 #4


va*********@gmail.com wrote:

But i need to send some GIF files as well to change
the colour of the block diagram. something like send a green arrow when
the equipment is UP and red arrow gif file when its down.

How can i avoid sending the GIF files, continuously to client ? Is it
possible for me to have one single GIF file, so that i can modify the
colour of the gif file with some option ?


I don't think browsers allow you to download a GIF image and then
manipulate parts of it. As you are talking about arrows however you
could check whether an Unicode character displaying an arrow comes close
to what you want to render with the GIF and then not use the GIF but the
character. If the character is then inside a e.g. a span element the
color change is simply done with CSS manipulation e.g.

var span = document.createElement('span');
span.appendChild(document.createTextNode('\u2192') );
span.onclick = function (evt) {
if (this.style) {
if (this.style.color == '' || this.style.color == 'red') {
this.style.color = 'green';
}
else {
this.style.color = 'red';
}
}
};
document.body.appendChild(span);

Character looks like this '→'. You can style it with CSS of course for
font size, color etc.
Unicode arrow characters are liste here (PDF!):
<http://www.unicode.org/charts/PDF/U2190.pdf>
With very few browser around (Opera 8, Firefox 1.5 beta) you can also
embed SVG graphics in a document and at least Firefox then allows script
to manipulate the SVG graphics.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Sep 14 '05 #5
va*********@gmail.com wrote:
Hi All,

I need to constantly update some values to the User Interface. In order
to do the updation efficiently, i am planning to run some script in the
server side that constantly keeps sending the values alone to the User
Interface client. But i need to send some GIF files as well to change
the colour of the block diagram. something like send a green arrow when
the equipment is UP and red arrow gif file when its down.

How can i avoid sending the GIF files, continuously to client ? Is it
possible for me to have one single GIF file, so that i can modify the
colour of the gif file with some option ?


Sounds like a job for XMLHTTP or a hidden <iframe>
Every X period of time, you have the browser make a new request
to the server, where a cgi or such could return a small
dynamicly generated XML file containing the status of
any number of items.

If you use a .cgi to report the equipment status, add something
like a randome filename made of the current date and time , with a file
extension of the data format being returned "TodaysDateAndTime.xml" One
could return the data as javascript too "TodaysDateAndTime.js".

http://www.yoursever.com/YourEquipmentStatus.cgi/
http://www.yoursever.com/YourEquipme...ateAndTime.xml

Either way , you can now take this returned data and use it to update
your client-side display without having to visibly load anything,
and without having to load any images at all.
--
--.
--=<> Dr. Clue (A.K.A. Ian A. Storms) <>=-- C++,HTML, CSS,Javascript
--=<> http://resume.drclue.net <>=-- AJAX, SOAP, XML, HTTP
--=<> http://www.drclue.net <>=-- SERVLETS,TCP/IP, SQL
--.
Sep 14 '05 #6

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

Similar topics

6
by: poisondart | last post by:
Is there a way to dynamically generate temporary files (such as an html, xml or text file) in Python? I'm not sure if I'm explaining myself clearly as I've no clue how to describe this...
4
by: cover | last post by:
I have a form with two drop down boxes that are hard coded as in the example below, and another drop down (pull down) box that is populated as a result of a MySQL query. All appears to work as it...
3
by: Sydney | last post by:
Hi, I am trying to construct a WSE 2.0 security SOAP request in VBScript on an HTML page to send off to a webservice. I think I've almost got it but I'm having an issue generating the nonce...
2
by: Giedrius | last post by:
hi, i have an idea to make admin tool on home computer, that would generate html files using some kind of templates and database data and put these generated html files to public web server, witch...
20
by: mike | last post by:
I help manage a large web site, one that has over 600 html pages... It's a reference site for ham radio folks and as an example, one page indexes over 1.8 gb of on-line PDF documents. The site...
6
by: RobGMiller | last post by:
Using ASP.NET 2.0 Need to simply process incoming postback information without sending back a reponse. Client sends HTML from application other than a browser to a page on a web site. Web...
6
by: howa | last post by:
Since it is part fo the standard, why I always heard that we should avoid iframe? any comments? thanks.
2
by: sat1983 | last post by:
Hi I am beginner to C Sharp. trying to attach a multiple files to a mail. I can attach a single file or i can create multiple object of an Attachment class and add to a mail attachment object....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
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...

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.