Welcome to WebmasterWorld Guest from 54.205.75.60

Forum Moderators: incrediBILL

Message Too Old, No Replies

<a href> within <head> section

   
4:39 pm on Nov 30, 2010 (gmt 0)



Doctype: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Hi I have the following code in a function within the <head> section. The w3c validator is telling me "document type does not allow element "a" here" and "document type does not allow element "br" here" for the line..."content:"<a href....." I need this line because it is popping up an infowindow which has a link to the appropriate web page, but I am not sure if I can use the <ahref> within the head section. I am using the ArcGIS Javascript extension for Google maps in my web page also.

function addResults(fset) {
var overlayOptions = {
strokeColor:"#FF0000",
strokeColor:"#00008B",
fillOpacity:0
}

var feature = fset.features[0];
var attrs = feature.attributes;
var CountyNm = attrs.NAME;

if(CountyNm == "Boone"){
var infoWindowOptions = {
content:"{NAME} County does not contain any data. &nbsp; &nbsp;"
}}
else if (CountyNm == "DeKalb"){
var infoWindowOptions = {
content:"{NAME} County does not contain any data. &nbsp; &nbsp;"
}}
else{
var infoWindowOptions = {
content:"<a href='javascript:openCountyWeb(\"{WEB_DIR}\")'><strong>Click here</strong></a> to view the {NAME} County web page &nbsp; &nbsp;<br /> for detailed information."
}};
5:34 pm on Nov 30, 2010 (gmt 0)

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Welcome to the forums, Loosh.

If validation is important, you can declare the function in an external .js file and call that file from within the <head> section.
6:01 pm on Nov 30, 2010 (gmt 0)



Hi thank you! I'll try that.