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;
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
add a comment
|
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
"@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
add a comment
|
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
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
javascript
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
add a comment
|
"@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
add a comment
|
3 Answers
3
active
oldest
votes
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
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
add a comment
|
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
add a comment
|
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.
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
add a comment
|
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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
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
add a comment
|
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
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
add a comment
|
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
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
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
add a comment
|
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
add a comment
|
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
add a comment
|
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
add a comment
|
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
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
answered Mar 28 at 20:20
jonathan Heindljonathan Heindl
6442 silver badges13 bronze badges
6442 silver badges13 bronze badges
add a comment
|
add a comment
|
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.
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
add a comment
|
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.
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
add a comment
|
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.
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.
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
add a comment
|
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
add a comment
|
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
"@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