Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trouble with images using CE .NET 4.1

Status
Not open for further replies.

HouseOf

Programmer
Jul 24, 2007
2
US
Hello,
I am constructing a webpage to be viewed on a Windows CE V4.1 computer. I have all the code working properly on my XP computer, and most will work on the CE computer; however, one line of code is giving me trouble. In the function below, I am creating a string, and then trying to set that string to the src of an <img> in my page.
Code:
function set_graph_url(TSP,DoseT,RecircT, XT) {
	var urlPath = "Linegraphdb.asp?Type=Line&TempSP=" + TSP + "&DoseTemp=" + DoseT + "&RecircTemp=" + RecircT + "&XT=" + XT;		
        document.getElementById("graphImg").src = urlPath;  /* This is the line that will not execute properly */
	}

	<img name="graphImg" id="graphImg" src="images/blank.gif" width="<% =Width %>" height="<% =Height %>" />  //This is the image I am trying to change

I realized this wouldn't work since the .getElementById is not supported by Windows CE V4.1. I have tried about 5 other variations of this code and none of them work either. Does anyone have any suggestions on how I can set the text string I create to the src of the image? I have listed below some of the other versions I have tried that haven't worked on the CE computer. Thanks for your help.

-HouseOf

Code:
function set_graph_url(TSP,DoseT,RecircT, XT) {
	var urlPath = "Linegraphdb.asp?Type=Line&TempSP=" + TSP + "&DoseTemp=" + DoseT + "&RecircTemp=" + RecircT + "&XT=" + XT; 
	document.all("graphImg").src = urlPath;  
	}

function set_graph_url(TSP,DoseT,RecircT, XT) {
	var urlPath = "Linegraphdb.asp?Type=Line&TempSP=" + TSP + "&DoseTemp=" + DoseT + "&RecircTemp=" + RecircT + "&XT=" + XT; 
	graphImg.src = urlPath;  	}

function set_graph_url(TSP,DoseT,RecircT, XT) {
		var urlPath = "Linegraphdb.asp?Type=Line&TempSP=" + TSP + "&DoseTemp=" + DoseT + "&RecircTemp=" + RecircT + "&XT=" + XT; 
	document.images.graphImg.src = urlPath;
}

var img;

function set_graph_url(TSP,DoseT,RecircT, XT) {

        var urlPath = "Linegraphdb.asp?Type=Line&TempSP=" + TSP + "&DoseTemp=" + DoseT + "&RecircTemp=" + RecircT + "&XT=" + XT; 
        img.src = urlPath;
	}

	<img name="graphImg" id="graphImg" src="C:\Documents and Settings\blank.gif" width="600" height="450" onload="img = this;"/>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top