user1463227
user1463227

Reputation: 3

creating marker with link using google map API - not working

hello i'm trying to display link to wikipedia value inside information window for each location that i retreive using google places api and google maps api.

i can show the obj.name and the icon of the catogry ,but for somereson the link for the wiki value just refresh the page and not redirect to the herf:

       var infowindow = new google.maps.InfoWindow ({content:
    '<img src="' 
    + obj.icon
    + '" /><font style="color:#000;">'
    + obj.name
//    + '<br />Rating: '
 //   + obj.rating
  //  + '<br />Vicinity: ' 
//    + obj.vicinity 
     + '</font>'
    + '<br/>'
 //   +'<a href "http://en.m.wikipedia.org/wiki/'
   // + wikiurl+'> wiki value </a>'
});     

this is the fiddle for the page itself http://jsfiddle.net/QUTfR/5/ please help me to understand what im doing worng

Upvotes: 0

Views: 95

Answers (1)

Dr.Molle
Dr.Molle

Reputation: 117354

This part is wrong:

  +'<a href "http://en.m.wikipedia.org/wiki/'
  //_______^  missing =
  + wikiurl+'> wiki value </a>'
  //________^ missing "

it has to be:

  +'<a href= "http://en.m.wikipedia.org/wiki/'
  + wikiurl+'"> wiki value </a>'

http://jsfiddle.net/doktormolle/QUTfR/11/

Upvotes: 1

Related Questions