SitePoint Sponsor

User Tag List

Page 2 of 2 FirstFirst 12
Results 26 to 30 of 30
  1. #26
    SitePoint Enthusiast
    Join Date
    Mar 2011
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry I moved it as its the best version!

    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.

    Thanks!

  2. #27
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,526
    Mentioned
    83 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by deucalion0 View Post
    Sorry I moved it as its the best version!

    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.
    Please provide the xml code you are trying to use for one of the non-working links.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  3. #28
    SitePoint Enthusiast
    Join Date
    Mar 2011
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry I had to step out for a bit.

    Here is the code in the xml file paul:

    Code:
    <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&lt;br&gt;First Info Window &lt;br&gt;With a &lt;a href="http://www.bbc.co.uk"&gt;Link&lt;/a&gt; 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&lt;br&gt;First Info Window &lt;br&gt;With a &lt;a href="http://www.bbc.co.uk"&gt;Link&lt;/a&gt; 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&lt;br&gt;First Info Window &lt;br&gt;With a &lt;a href="http://www.bbc.co.uk"&gt;Link&lt;/a&gt; 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&lt;br&gt;First Info Window &lt;br&gt;With a &lt;a href="http://www.bbc.co.uk"&gt;Link&lt;/a&gt; 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&lt;br&gt;First Info Window &lt;br&gt;With a &lt;a href="http://www.bbc.co.uk"&gt;Link&lt;/a&gt; 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&lt;br&gt;First Info Window &lt;br&gt;With a &lt;a href="http://www.bbc.co.uk"&gt;Link&lt;/a&gt; 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&lt;br&gt;First Info Window &lt;br&gt;With a &lt;a href="http://www.bbc.co.uk"&gt;Link&lt;/a&gt; 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&lt;br&gt;First Info Window &lt;br&gt;With a &lt;a href="http://www.bbc.co.uk"&gt;Link&lt;/a&gt; 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&lt;br&gt;First Info Window &lt;br&gt;With a &lt;a href="http://www.bbc.co.uk"&gt;Link&lt;/a&gt; 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&lt;br&gt;First Info Window &lt;br&gt;With a &lt;a href="http://www.bbc.co.uk"&gt;Link&lt;/a&gt; to my home page'
     category="members"
      label="Marker Ten" 
     />
    </markers>
    Thanks!!

  4. #29
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,526
    Mentioned
    83 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by deucalion0 View Post
    Here is the code in the xml file paul:
    Okay, you have code that gets the attributes for address/name/category

    Your code doesn't yet make use of the html attribute.

    Code javascript:
    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?

    Code:
    var address = markers[i].getAttribute("address");
    var name = markers[i].getAttribute("name");
    var html = markers[i].getAttribute("html");
    var html = "<b>"+name+"<\/b><p>"+address+"</p>"+html;
    var category = markers[i].getAttribute("category");
    Last edited by paul_wilkins; Mar 27, 2011 at 15:38.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  5. #30
    SitePoint Enthusiast
    Join Date
    Mar 2011
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Paul that got it working, thanks again, I think I can leave you alone now, hopefully!

    I added the extra line and removed the var and it does what I want now, so thanks a lot!!



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •