Need help creating clickable url link for google map's infowindowIs there a link to the “latest” jQuery library on Google APIs?Google Maps API v3 : Click events not triggered in firefox for custom markerGoogle Map V3 Infowindow.open errorUsing events on dynamic markersgmap3 click marker for directionsPassing array as parameter google mapsScope of ng-click on a dynamically created button not working on Google MapRemoving Google Maps Markers that are added dynamically with hover event over Chart.js ChartESLint errors with .js file

Lost passport and visa, tried to reapply, got rejected twice. What are my next steps?

Phonetic distortion when words are borrowed among languages

How deep is the liquid in a half-full hemisphere?

As a team leader is it appropriate to bring in fundraiser candy?

Incomplete iffalse: How to shift a scope in polar coordinate?

If a spaceship ran out of fuel somewhere in space between Earth and Mars, does it slowly drift off to the Sun?

Why aren't faces sharp in my f/1.8 portraits even though I'm carefully using center-point autofocus?

Beyond Futuristic Technology for an Alien Warship?

Calculate the Ultraradical

What could cause lower torque than normal during cruise in a King Air 300?

Verb ending in -ん with positive meaning?

What are one's options when facing religious discrimination at the airport?

How do we know neutrons have no charge?

How to identify whether a publisher is genuine or not?

Detail vs. filler

What organs or modifications would be needed to have hairy fish?

My machine, client installed VPN,

French license plates

Was the ruling that prorogation was unlawful only possible because of the creation of a separate supreme court?

How to say "respectively" in German when listing (enumerating) things

Why isn't there armor to protect from spells in the Potterverse?

Can I pay some of the cost of an activated ability lots of times to get more out of the effect?

How to study endgames?

Which Catholic priests were given diplomatic missions?



Need help creating clickable url link for google map's infowindow


Is there a link to the “latest” jQuery library on Google APIs?Google Maps API v3 : Click events not triggered in firefox for custom markerGoogle Map V3 Infowindow.open errorUsing events on dynamic markersgmap3 click marker for directionsPassing array as parameter google mapsScope of ng-click on a dynamically created button not working on Google MapRemoving Google Maps Markers that are added dynamically with hover event over Chart.js ChartESLint errors with .js file






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I'm unable to create a clickable url link for Google Map's infowindow. I'm sure it's a syntax error, just not sure where exactly.



Here's a snippet of my code



 var marker = new google.maps.Marker(
map: map,
title: eventName,
position: loc
);
var content =
"<strong>" + "@location.venue_name" + "</strong><br>" +
"@location.venue_address" + " " + "@location.city_name" + "<br>" +
"@location.description" + "<br>" +

"@location.url" + "<br>" + //displays url eg. 'www.google.com'

//"<a href=" + "@location.url" + "target="_blank">More Details</a><br>"; // map won't show if this line is uncommented

var infowindow = new google.maps.InfoWindow();
google.maps.event.addListener(marker, 'click', (function (marker, content)
return function ()
infowindow.setContent(content);
infowindow.open(map, marker);
;
)(marker, content));


Thank you in advance










share|improve this question


























  • "@location.url" + "</div>" +

    – Alon Eitan
    Mar 28 at 20:09











  • that extra </div> was left by mistake, I edited it out of the original post.

    – MBrewers
    Mar 28 at 20:11











  • I think you need to add escaped quotes (or single quotes) around the url and _blank and a space after

    – jonathan Heindl
    Mar 28 at 20:15


















0















I'm unable to create a clickable url link for Google Map's infowindow. I'm sure it's a syntax error, just not sure where exactly.



Here's a snippet of my code



 var marker = new google.maps.Marker(
map: map,
title: eventName,
position: loc
);
var content =
"<strong>" + "@location.venue_name" + "</strong><br>" +
"@location.venue_address" + " " + "@location.city_name" + "<br>" +
"@location.description" + "<br>" +

"@location.url" + "<br>" + //displays url eg. 'www.google.com'

//"<a href=" + "@location.url" + "target="_blank">More Details</a><br>"; // map won't show if this line is uncommented

var infowindow = new google.maps.InfoWindow();
google.maps.event.addListener(marker, 'click', (function (marker, content)
return function ()
infowindow.setContent(content);
infowindow.open(map, marker);
;
)(marker, content));


Thank you in advance










share|improve this question


























  • "@location.url" + "</div>" +

    – Alon Eitan
    Mar 28 at 20:09











  • that extra </div> was left by mistake, I edited it out of the original post.

    – MBrewers
    Mar 28 at 20:11











  • I think you need to add escaped quotes (or single quotes) around the url and _blank and a space after

    – jonathan Heindl
    Mar 28 at 20:15














0












0








0








I'm unable to create a clickable url link for Google Map's infowindow. I'm sure it's a syntax error, just not sure where exactly.



Here's a snippet of my code



 var marker = new google.maps.Marker(
map: map,
title: eventName,
position: loc
);
var content =
"<strong>" + "@location.venue_name" + "</strong><br>" +
"@location.venue_address" + " " + "@location.city_name" + "<br>" +
"@location.description" + "<br>" +

"@location.url" + "<br>" + //displays url eg. 'www.google.com'

//"<a href=" + "@location.url" + "target="_blank">More Details</a><br>"; // map won't show if this line is uncommented

var infowindow = new google.maps.InfoWindow();
google.maps.event.addListener(marker, 'click', (function (marker, content)
return function ()
infowindow.setContent(content);
infowindow.open(map, marker);
;
)(marker, content));


Thank you in advance










share|improve this question
















I'm unable to create a clickable url link for Google Map's infowindow. I'm sure it's a syntax error, just not sure where exactly.



Here's a snippet of my code



 var marker = new google.maps.Marker(
map: map,
title: eventName,
position: loc
);
var content =
"<strong>" + "@location.venue_name" + "</strong><br>" +
"@location.venue_address" + " " + "@location.city_name" + "<br>" +
"@location.description" + "<br>" +

"@location.url" + "<br>" + //displays url eg. 'www.google.com'

//"<a href=" + "@location.url" + "target="_blank">More Details</a><br>"; // map won't show if this line is uncommented

var infowindow = new google.maps.InfoWindow();
google.maps.event.addListener(marker, 'click', (function (marker, content)
return function ()
infowindow.setContent(content);
infowindow.open(map, marker);
;
)(marker, content));


Thank you in advance







javascript






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 28 at 20:15







MBrewers

















asked Mar 28 at 20:08









MBrewersMBrewers

667 bronze badges




667 bronze badges















  • "@location.url" + "</div>" +

    – Alon Eitan
    Mar 28 at 20:09











  • that extra </div> was left by mistake, I edited it out of the original post.

    – MBrewers
    Mar 28 at 20:11











  • I think you need to add escaped quotes (or single quotes) around the url and _blank and a space after

    – jonathan Heindl
    Mar 28 at 20:15


















  • "@location.url" + "</div>" +

    – Alon Eitan
    Mar 28 at 20:09











  • that extra </div> was left by mistake, I edited it out of the original post.

    – MBrewers
    Mar 28 at 20:11











  • I think you need to add escaped quotes (or single quotes) around the url and _blank and a space after

    – jonathan Heindl
    Mar 28 at 20:15

















"@location.url" + "</div>" +

– Alon Eitan
Mar 28 at 20:09





"@location.url" + "</div>" +

– Alon Eitan
Mar 28 at 20:09













that extra </div> was left by mistake, I edited it out of the original post.

– MBrewers
Mar 28 at 20:11





that extra </div> was left by mistake, I edited it out of the original post.

– MBrewers
Mar 28 at 20:11













I think you need to add escaped quotes (or single quotes) around the url and _blank and a space after

– jonathan Heindl
Mar 28 at 20:15






I think you need to add escaped quotes (or single quotes) around the url and _blank and a space after

– jonathan Heindl
Mar 28 at 20:15













3 Answers
3






active

oldest

votes


















0
















Please try this one:



var content =
"<strong>" + "@location.venue_name" + "</strong><br>" +
"@location.venue_address" + " " + "@location.city_name" + "<br>" +
"@location.description" + "</div>" +
"@location.url" + "<br>" +
"<a href='" + "@location.url" + "' target='_blank'>More Details</a><br>";


Notice I have changed quotes a little bit in the last line. Hope it helps






share|improve this answer

























  • Thanks Sebastian, that worked. I had tried something like that earlier but with the single quote after the double quote. Putting the single quote before the double quote fixed it.

    – MBrewers
    Mar 28 at 20:22


















0
















preferably in one single string :



"<a href='@location.url' target='_blank'>More Details</a><br>"


thats easier for the eyes



pretty sure the @... injections works in longer strings as well






share|improve this answer
































    0
















    syntax got a bit messy there on content variable.



    change your line as follows



    <a href='" + "@location.url" + "' target='_blank'>More Details</a><br>"



    also take a look at template literals for js which will make you code much more readable with a "`" (backtick)



    var content = `<strong>$@location.venue_name</strong>
    <br>
    $@location.venue_address $@location.city_name $@location.url
    <a href='$@location.url' target='_blank'>More details</a>
    `


    this way you can avoid a lot of mess trying to build a string. $ will allow you to put Js variables inside a backticked string.






    share|improve this answer






















    • 1





      you also need quotes around href

      – jonathan Heindl
      Mar 28 at 20:19











    • @jonathanHeindl Yup just seen it now :D. thank you, corrected it now :)

      – FedeSc
      Mar 28 at 20:19














    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );














    draft saved

    draft discarded
















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55406058%2fneed-help-creating-clickable-url-link-for-google-maps-infowindow%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    3 Answers
    3






    active

    oldest

    votes








    3 Answers
    3






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0
















    Please try this one:



    var content =
    "<strong>" + "@location.venue_name" + "</strong><br>" +
    "@location.venue_address" + " " + "@location.city_name" + "<br>" +
    "@location.description" + "</div>" +
    "@location.url" + "<br>" +
    "<a href='" + "@location.url" + "' target='_blank'>More Details</a><br>";


    Notice I have changed quotes a little bit in the last line. Hope it helps






    share|improve this answer

























    • Thanks Sebastian, that worked. I had tried something like that earlier but with the single quote after the double quote. Putting the single quote before the double quote fixed it.

      – MBrewers
      Mar 28 at 20:22















    0
















    Please try this one:



    var content =
    "<strong>" + "@location.venue_name" + "</strong><br>" +
    "@location.venue_address" + " " + "@location.city_name" + "<br>" +
    "@location.description" + "</div>" +
    "@location.url" + "<br>" +
    "<a href='" + "@location.url" + "' target='_blank'>More Details</a><br>";


    Notice I have changed quotes a little bit in the last line. Hope it helps






    share|improve this answer

























    • Thanks Sebastian, that worked. I had tried something like that earlier but with the single quote after the double quote. Putting the single quote before the double quote fixed it.

      – MBrewers
      Mar 28 at 20:22













    0














    0










    0









    Please try this one:



    var content =
    "<strong>" + "@location.venue_name" + "</strong><br>" +
    "@location.venue_address" + " " + "@location.city_name" + "<br>" +
    "@location.description" + "</div>" +
    "@location.url" + "<br>" +
    "<a href='" + "@location.url" + "' target='_blank'>More Details</a><br>";


    Notice I have changed quotes a little bit in the last line. Hope it helps






    share|improve this answer













    Please try this one:



    var content =
    "<strong>" + "@location.venue_name" + "</strong><br>" +
    "@location.venue_address" + " " + "@location.city_name" + "<br>" +
    "@location.description" + "</div>" +
    "@location.url" + "<br>" +
    "<a href='" + "@location.url" + "' target='_blank'>More Details</a><br>";


    Notice I have changed quotes a little bit in the last line. Hope it helps







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Mar 28 at 20:17









    Sebastian KaczmarekSebastian Kaczmarek

    1,9421 gold badge10 silver badges26 bronze badges




    1,9421 gold badge10 silver badges26 bronze badges















    • Thanks Sebastian, that worked. I had tried something like that earlier but with the single quote after the double quote. Putting the single quote before the double quote fixed it.

      – MBrewers
      Mar 28 at 20:22

















    • Thanks Sebastian, that worked. I had tried something like that earlier but with the single quote after the double quote. Putting the single quote before the double quote fixed it.

      – MBrewers
      Mar 28 at 20:22
















    Thanks Sebastian, that worked. I had tried something like that earlier but with the single quote after the double quote. Putting the single quote before the double quote fixed it.

    – MBrewers
    Mar 28 at 20:22





    Thanks Sebastian, that worked. I had tried something like that earlier but with the single quote after the double quote. Putting the single quote before the double quote fixed it.

    – MBrewers
    Mar 28 at 20:22













    0
















    preferably in one single string :



    "<a href='@location.url' target='_blank'>More Details</a><br>"


    thats easier for the eyes



    pretty sure the @... injections works in longer strings as well






    share|improve this answer





























      0
















      preferably in one single string :



      "<a href='@location.url' target='_blank'>More Details</a><br>"


      thats easier for the eyes



      pretty sure the @... injections works in longer strings as well






      share|improve this answer



























        0














        0










        0









        preferably in one single string :



        "<a href='@location.url' target='_blank'>More Details</a><br>"


        thats easier for the eyes



        pretty sure the @... injections works in longer strings as well






        share|improve this answer













        preferably in one single string :



        "<a href='@location.url' target='_blank'>More Details</a><br>"


        thats easier for the eyes



        pretty sure the @... injections works in longer strings as well







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 28 at 20:20









        jonathan Heindljonathan Heindl

        6442 silver badges13 bronze badges




        6442 silver badges13 bronze badges
























            0
















            syntax got a bit messy there on content variable.



            change your line as follows



            <a href='" + "@location.url" + "' target='_blank'>More Details</a><br>"



            also take a look at template literals for js which will make you code much more readable with a "`" (backtick)



            var content = `<strong>$@location.venue_name</strong>
            <br>
            $@location.venue_address $@location.city_name $@location.url
            <a href='$@location.url' target='_blank'>More details</a>
            `


            this way you can avoid a lot of mess trying to build a string. $ will allow you to put Js variables inside a backticked string.






            share|improve this answer






















            • 1





              you also need quotes around href

              – jonathan Heindl
              Mar 28 at 20:19











            • @jonathanHeindl Yup just seen it now :D. thank you, corrected it now :)

              – FedeSc
              Mar 28 at 20:19
















            0
















            syntax got a bit messy there on content variable.



            change your line as follows



            <a href='" + "@location.url" + "' target='_blank'>More Details</a><br>"



            also take a look at template literals for js which will make you code much more readable with a "`" (backtick)



            var content = `<strong>$@location.venue_name</strong>
            <br>
            $@location.venue_address $@location.city_name $@location.url
            <a href='$@location.url' target='_blank'>More details</a>
            `


            this way you can avoid a lot of mess trying to build a string. $ will allow you to put Js variables inside a backticked string.






            share|improve this answer






















            • 1





              you also need quotes around href

              – jonathan Heindl
              Mar 28 at 20:19











            • @jonathanHeindl Yup just seen it now :D. thank you, corrected it now :)

              – FedeSc
              Mar 28 at 20:19














            0














            0










            0









            syntax got a bit messy there on content variable.



            change your line as follows



            <a href='" + "@location.url" + "' target='_blank'>More Details</a><br>"



            also take a look at template literals for js which will make you code much more readable with a "`" (backtick)



            var content = `<strong>$@location.venue_name</strong>
            <br>
            $@location.venue_address $@location.city_name $@location.url
            <a href='$@location.url' target='_blank'>More details</a>
            `


            this way you can avoid a lot of mess trying to build a string. $ will allow you to put Js variables inside a backticked string.






            share|improve this answer















            syntax got a bit messy there on content variable.



            change your line as follows



            <a href='" + "@location.url" + "' target='_blank'>More Details</a><br>"



            also take a look at template literals for js which will make you code much more readable with a "`" (backtick)



            var content = `<strong>$@location.venue_name</strong>
            <br>
            $@location.venue_address $@location.city_name $@location.url
            <a href='$@location.url' target='_blank'>More details</a>
            `


            this way you can avoid a lot of mess trying to build a string. $ will allow you to put Js variables inside a backticked string.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Mar 28 at 20:28

























            answered Mar 28 at 20:17









            FedeScFedeSc

            1,15711 silver badges29 bronze badges




            1,15711 silver badges29 bronze badges










            • 1





              you also need quotes around href

              – jonathan Heindl
              Mar 28 at 20:19











            • @jonathanHeindl Yup just seen it now :D. thank you, corrected it now :)

              – FedeSc
              Mar 28 at 20:19













            • 1





              you also need quotes around href

              – jonathan Heindl
              Mar 28 at 20:19











            • @jonathanHeindl Yup just seen it now :D. thank you, corrected it now :)

              – FedeSc
              Mar 28 at 20:19








            1




            1





            you also need quotes around href

            – jonathan Heindl
            Mar 28 at 20:19





            you also need quotes around href

            – jonathan Heindl
            Mar 28 at 20:19













            @jonathanHeindl Yup just seen it now :D. thank you, corrected it now :)

            – FedeSc
            Mar 28 at 20:19






            @jonathanHeindl Yup just seen it now :D. thank you, corrected it now :)

            – FedeSc
            Mar 28 at 20:19



















            draft saved

            draft discarded















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55406058%2fneed-help-creating-clickable-url-link-for-google-maps-infowindow%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

            Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

            Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript