Welcome to WebmasterWorld Guest from 54.167.46.29

Forum Moderators: incrediBILL

Message Too Old, No Replies

<a href> within <head> section

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

New User

5+ Year Member

joined:Nov 30, 2010
posts:2
votes: 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)

Senior Member

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

joined:May 26, 2000
posts:37301
votes: 0


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)

New User

5+ Year Member

joined:Nov 30, 2010
posts:2
votes: 0


Hi thank you! I'll try that.
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members