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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Other Language Using Javascript

Status
Not open for further replies.

internetguy

Technical User
Nov 22, 2003
57
0
0
US
I am doing a project where you click on a location on a map, and Coldfusion will query a database for that location. I got everything to work right, except for the fact that the coldfusion tags are being ignored. I have a function that sets a td tag's innerHTML to display the query results.

Code:
<map name="arizona">
<area shape="rect" coords="40,124,90,148" href="#" onClick="displaylocation('25')">
</map>

function displaylocation(location){
	el = document.getElementById("location");
	el.innerHTML = "<cfquery datasource='spi' name='getlocations'>SELECT * FROM spi_div WHERE id='"+location+"'</cfquery><p><cfoutput query='getlocations'>#street#<br>#city# #st# #zip#<br>Phone - #phone#<br>Fax - #fax#</cfoutput>";
}
When executed it displays the data, but only the "SELECT * FROM spi_div..." coldfusion commands along with the variables below. Does innerHTML ignore server side languages and do HTML only?
 
server side languages are interpreted on the server at render time. you cannot do a client-side replace of a tag's innerHTML and expect the server to parse it.


-jeff
try { succeed(); } catch(E) { tryAgain(); } finally { rtfm(); }
i like your sleeves...they're real big
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top