473,800 Members | 3,001 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1769
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*********@gma il.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*********@gma il.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.styl e.display = ( isUp )? '' : 'none';
redArrow.style. display = ( isUp )? 'none' : '';
...


--
Rob
Sep 14 '05 #4


va*********@gma il.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.create Element('span') ;
span.appendChil d(document.crea teTextNode('\u2 192'));
span.onclick = function (evt) {
if (this.style) {
if (this.style.col or == '' || this.style.colo r == 'red') {
this.style.colo r = 'green';
}
else {
this.style.colo r = 'red';
}
}
};
document.body.a ppendChild(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*********@gma il.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 "TodaysDateAndT ime.xml" One
could return the data as javascript too "TodaysDateAndT ime.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
2192
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 mechanism. I've seen it on certain websites that will generate a file under certain parameters (through forms) that will dissapear (i.e. delete itself) after a specified amount of time. These files usually have some phony string for their filenames...like...
4
4097
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 should with the exception that after choices have been made and the submit button clicked, (to either enter the data into another database OR work together in another query - I've tried both), the field that was populated by the initial query...
3
7732
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 value for the UserName token. Is it possilbe at all to do this from VBScript (or jscript?)? I know I will be limited with what I can do with the SOAP message. Eg/ can't sign/encrypt it etc. Thanks,
2
1784
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 doesn't have running asp.net, using ftp access. why i need so? because: 1) my project doesn't need to receive any data from browsing customers, it will be only company news, info about new products - so it's enough to have static html on...
20
4292
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 is structured as an upside-down tree, and (if I remember correctly) never more than 4 levels. The site basically grew (like the creeping black blob) ... all the pages were created in Notepad over the last
6
3421
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 Server ASP generates a response page and send it back which opens the browser on the client. How to avoid sending back the response page.
6
10556
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
2702
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. But when i want to do it dynamically to attach multiple file...say my code might be generating one or more files depending on the result set... I have a temporary variable will keep track of no. of attachments and their path.
0
9555
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
10287
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
10260
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
9099
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...
1
7588
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5479
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...
1
4156
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
3770
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2956
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.