I’ve been serious on JavaScript for around 6 years, with several more of dabbling before that.
JavaScript has become the language of choice for scripting web pages, so I don’t see it being replaced for the next 5 to 10 years. Beyond that is anyone’s guess.
Isn’t the html using this instead of quotes html=’ ’
I tried to use html=" " but then the markers stopped working when I done that. I have looked online for how to do this but all the examples I have seen use seperate tags, whereas all mine is in one marker tag.
The xml file is located in the same directory as all the other files, the html, javascript and iimage folders. The page works fine but its just missing the link
The html in the xml should contain links such as BBC - Homepage but when I put that in the html, the code breaks, so I removed the urls from all the html parts of the markers, so none of the links work, yet.
<markers>
<!-- Dont use copy and paste on this XML file, use "View Source" or "Save As"
What the browser displays is *interpreted* XML, not XML source. -->
<marker lat="30.2672" lng="-97.7431"
name="pantera"
address="Austin, Texas"
html='Some stuff to display in the<br>First Info Window <br>With a <a href="http://www.bbc.co.uk">Link</a> to my home page'
category="bands"
label="Marker One"
/>
<marker lat="52.5234" lng="13.4114 "
name="Rammstein"
address="Berlin, Germany"
html='Some stuff to display in the<br>First Info Window <br>With a <a href="http://www.bbc.co.uk">Link</a> to my home page'
category="bands"
label="Marker Two"
/>
<marker lat="60.1698" lng="24.9382 "
name="Children of Bodom"
address="Helsinki, Finland"
html='Some stuff to display in the<br>First Info Window <br>With a <a href="http://www.bbc.co.uk">Link</a> to my home page'
category="bands"
label="Marker Three"
/>
<marker lat="57.6970" lng=" 11.9865 "
name="In Flames"
address="Gothenburg, Sweden"
html='Some stuff to display in the<br>First Info Window <br>With a <a href="http://www.bbc.co.uk">Link</a> to my home page'
category="bands"
label="Marker Four"
/>
<marker lat="37.8044" lng="-122.2711 "
name="Machine head"
address="Oakland, California"
html='Some stuff to display in the<br>First Info Window <br>With a <a href="http://www.bbc.co.uk">Link</a> to my home page'
category="bands"
label="Marker Five"
/>
<marker lat="" lng=""
name=""
address=""
html=''
category=""
label="Marker blank"
/>
<marker lat="43.9" lng="-79.5"
name="Philip Anselmo of Pantera"
address="14 avenue"
html='Some stuff to display in the<br>First Info Window <br>With a <a href="http://www.bbc.co.uk">Link</a> to my home page'
category="members"
label="Marker Six"
/>
<marker lat="43.9" lng="-79.5"
name="Dimebag Darrell of Pantera"
address="14 avenue"
html='Some stuff to display in the<br>First Info Window <br>With a <a href="http://www.bbc.co.uk">Link</a> to my home page'
category="members"
label="Marker Seven"
/>
<marker lat="43.9" lng="-79.5"
name="Vinnie Paul of Pantera"
address="14 avenue"
html='Some stuff to display in the<br>First Info Window <br>With a <a href="http://www.bbc.co.uk">Link</a> to my home page'
category="members"
label="Marker Eight"
/>
<marker lat="43.9" lng="-79.5"
name="Rex Brown of Pantera"
address="14 avenue"
html='Some stuff to display in the<br>First Info Window <br>With a <a href="http://www.bbc.co.uk">Link</a> to my home page'
category="members"
label="Marker Nine"
/>
<marker lat="" lng=""
name=""
address=""
html=''
category=""
label="Marker blank"
/>
<marker lat="43.9" lng="-79.5"
name="Til Lindemann of Rammstein"
address="14 avenue"
html='Some stuff to display in the<br>First Info Window <br>With a <a href="http://www.bbc.co.uk">Link</a> to my home page'
category="members"
label="Marker Ten"
/>
</markers>
Okay, you have code that gets the attributes for address/name/category
Your code doesn’t yet make use of the html attribute.
var address = markers[i].getAttribute("address");
var name = markers[i].getAttribute("name");
var html = "<b>"+name+"<\\/b><p>"+address;
var category = markers[i].getAttribute("category");
Are you asking me how to include the use of the your xml attribute called html?
Could it be that this is what you’re asking about?
var address = markers[i].getAttribute("address");
var name = markers[i].getAttribute("name");
[color="green"]var html = markers[i].getAttribute("html");[/color]
[s][color="red"]var [/color][/s]html = "<b>"+name+"<\\/b><p>"+address[color="green"]+"</p>"+html[/color];
var category = markers[i].getAttribute("category");