473,779 Members | 2,047 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dynamically changing the HTML in a page.

Hello,

Now I think that there is a simple answer to my problem, but I don't
know what it is and I can't work out what I should be searching for on
the internet to read up some more about it. Here is my problem:

I have a webpage that shows a graph. The graph is a streamed image
from another webpage. This works perfectly, see code below, I have
just written some HTML to display the graph.

<P align=center><I MG style="Z-INDEX: 105; LEFT: 9px; WIDTH: 950px;
POSITION: absolute; TOP: 217px; HEIGHT: 150px" height=150
alt=Temperature ! src="draw_Graph _1.aspx?Channel =29&amp;Hours=1 68"
width=950 border=0 ></P>

However, what I would like to do is to change the "Channel=29 " to
something that the user has selected, so that they can change the
graph. Something like "Channel=iNewCh annel", but I just don't know
how to go about this.

Thanks in adavance,
Smele.
Nov 18 '05 #1
3 1222
Use an image control out of the toolbox and build the src property
dynamically.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com

"SGA Smele" <si*********@ho tmail.com> wrote in message
news:23******** *************** **@posting.goog le.com...
Hello,

Now I think that there is a simple answer to my problem, but I don't
know what it is and I can't work out what I should be searching for on
the internet to read up some more about it. Here is my problem:

I have a webpage that shows a graph. The graph is a streamed image
from another webpage. This works perfectly, see code below, I have
just written some HTML to display the graph.

<P align=center><I MG style="Z-INDEX: 105; LEFT: 9px; WIDTH: 950px;
POSITION: absolute; TOP: 217px; HEIGHT: 150px" height=150
alt=Temperature ! src="draw_Graph _1.aspx?Channel =29&amp;Hours=1 68"
width=950 border=0 ></P>

However, what I would like to do is to change the "Channel=29 " to
something that the user has selected, so that they can change the
graph. Something like "Channel=iNewCh annel", but I just don't know
how to go about this.

Thanks in adavance,
Smele.

Nov 18 '05 #2
You can do this using javascript. Give your image an ID, so you can access
it using the DOM, and then dynamically change the source:

Add a client side function to your page:

<script language="javas cript">
<!--
function changeChannel (newChannel)
{
// Reference to the image
var img = document.all["graphImage "];

// Get the current source
var oldsrc = img.src;

// Replace the channel
var newsrc = oldsrc.replace(/Channel=[\d]+/, "Channel=" +
newChannel);

// Update the source
img.src = newsrc;
}
//-->
</script>

Create your image, with an ID. Additional attributes have been omitted as
they are not relevant to this example:

<img id="graphImage " src="draw_Graph _1.aspx?Channel =29&amp;Hours=1 68">

Now, you can simple change the source, by calling the changeChannel function
with the new channel ID. Eg.

<input type="button" value="Channel 15" onClick="change Channel(15)">

Hope this helps,

Mun


"SGA Smele" <si*********@ho tmail.com> wrote in message
news:23******** *************** **@posting.goog le.com...
Hello,

Now I think that there is a simple answer to my problem, but I don't
know what it is and I can't work out what I should be searching for on
the internet to read up some more about it. Here is my problem:

I have a webpage that shows a graph. The graph is a streamed image
from another webpage. This works perfectly, see code below, I have
just written some HTML to display the graph.

<P align=center><I MG style="Z-INDEX: 105; LEFT: 9px; WIDTH: 950px;
POSITION: absolute; TOP: 217px; HEIGHT: 150px" height=150
alt=Temperature ! src="draw_Graph _1.aspx?Channel =29&amp;Hours=1 68"
width=950 border=0 ></P>

However, what I would like to do is to change the "Channel=29 " to
something that the user has selected, so that they can change the
graph. Something like "Channel=iNewCh annel", but I just don't know
how to go about this.

Thanks in adavance,
Smele.

Nov 18 '05 #3
Thanks very much, I knew there would be a simple solution...
"Munsifali Rashid" <mun.news@#Remo veToReply#cordl essmouse.co.uk> wrote in message news:<#O******* *******@TK2MSFT NGP11.phx.gbl>. ..
You can do this using javascript. Give your image an ID, so you can access
it using the DOM, and then dynamically change the source:

Add a client side function to your page:

<script language="javas cript">
<!--
function changeChannel (newChannel)
{
// Reference to the image
var img = document.all["graphImage "];

// Get the current source
var oldsrc = img.src;

// Replace the channel
var newsrc = oldsrc.replace(/Channel=[\d]+/, "Channel=" +
newChannel);

// Update the source
img.src = newsrc;
}
//-->
</script>

Create your image, with an ID. Additional attributes have been omitted as
they are not relevant to this example:

<img id="graphImage " src="draw_Graph _1.aspx?Channel =29&amp;Hours=1 68">

Now, you can simple change the source, by calling the changeChannel function
with the new channel ID. Eg.

<input type="button" value="Channel 15" onClick="change Channel(15)">

Hope this helps,

Mun


"SGA Smele" <si*********@ho tmail.com> wrote in message
news:23******** *************** **@posting.goog le.com...
Hello,

Now I think that there is a simple answer to my problem, but I don't
know what it is and I can't work out what I should be searching for on
the internet to read up some more about it. Here is my problem:

I have a webpage that shows a graph. The graph is a streamed image
from another webpage. This works perfectly, see code below, I have
just written some HTML to display the graph.

<P align=center><I MG style="Z-INDEX: 105; LEFT: 9px; WIDTH: 950px;
POSITION: absolute; TOP: 217px; HEIGHT: 150px" height=150
alt=Temperature ! src="draw_Graph _1.aspx?Channel =29&amp;Hours=1 68"
width=950 border=0 ></P>

However, what I would like to do is to change the "Channel=29 " to
something that the user has selected, so that they can change the
graph. Something like "Channel=iNewCh annel", but I just don't know
how to go about this.

Thanks in adavance,
Smele.

Nov 18 '05 #4

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

Similar topics

2
2871
by: wjbell | last post by:
I have a piece of javascript I need to modify. Right now it changes a stylesheet in the document between style.css and no_indent.css. These are in the head of my document: <link rel=stylesheet href=/style.css> <link rel=stylesheet href=/no_indent.css> <link rel=stylesheet href=/style.css> What the code below does is toggle between the two depending on what
1
2892
by: C A Upsdell | last post by:
I have a site where I am setting a style dynamically, using the JS statement: obj.style.backgroundImage = 'url(img/bak_page.jpg)'; where 'obj' is either document.getElementById(id), or document.all, depending on browser support. This works just fine, with just one small problem: I want to set the style ONLY for screen media, not for printer media; the above statement appears to
2
14802
by: DartmanX | last post by:
I doubt this is possible, but I want to ask, just in case it is. I have a project going using Google Maps. This project spits out an HTML page template for people to post to their website and display a map. Most of the people doing this will have limited knowledge of HTML. I want to ensure that this page remains an XHTML 1.0 Transitional (or Strict) page, in case some newbie removes the DOCTYPE or some slightly more knowledgeable tries...
6
2251
by: Test Message | last post by:
I need to dynamically add an html control to a web form. What I have, thus far, adds the control to the page, but only places it after the closing "</html>" tag. System.Web.UI.HtmlControls.HtmlInputHidden h = new HtmlInputHidden(); h.ID = "FIELD1"; h.Value = "Value1"; Page.Controls.Add (h);
2
2289
by: ezmiller | last post by:
Hi, I have some code (which I will paste in below) that writes out some HTML dynamically using the W3C DOM...the last part of the code write out a simple table. MY problem is that the table is not showing up, even though it seems to be part of the document (i.e. I can reach the nodes through through document.body.getElementsByTagName... ) var e; var f; // Will hold a document fragment.
2
1576
by: gralexp | last post by:
Hi Guys. I have a problem, and for some reason I have not been able to find an answer on the net. In a nutshell, I have some codes on my page, which I want to change to an appropriate string (from a hashtable). Since I do not want to pass this hashtable to a function all the time I encounter it on the page, I want to do it once, in one function. Just capture HTML before rendering the page, and then replace codes with my strings. Any...
1
2604
by: adamredwards | last post by:
I have a page with some form elements that are dynamically generated. They are inserted into the dom by first cloning a node, changing the values like name, and then inserted with insertBefore(). When a field gets added, a link that opens a popup window is next to it. The popup is opened and has the name of the parent element it should change in it. The user can use the popup to get a list of results. In the results I would like them...
2
1832
by: tshad | last post by:
Is there a way to dynamically add in User Controls where I would get the name from a session variable: If I have the following code: ****************************************************************************** <%@ Page Language="C#" trace="false" debug="true" ContentType="text/html" ResponseEncoding="iso-8859-1" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
4
3647
by: Ed Jay | last post by:
I generate a DHTML page (a medical report) with dynamically generated text based on user input (answers to questions). The page length changes dynamically. I desire that when the page is printed and reaches a specific length, it terminates printing that page, prints a page number, and then begins to print the next page using the same header and format as the previous page. The page uses no tables or paragraph elements, only CSS. IOW, I...
0
9471
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
10302
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9925
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7478
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
6723
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5372
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
4036
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
3631
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2867
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.