I am using google maps and the infowindow that opens on the click of the marker calls a JavaScript function.
There is another function with multiple parameters that has to be called from this function.
The following is my code:
function createMarker(point,custid,streetadd,city,state,zip,address,phone,website,co) {
var infowindowHover,infowindowClick;
var hoverText = "<CENTER><B>" + co + "</B></CENTER>";
var markerMarkup = "<TABLE><TR><TD colspan='2'><B>";
markerMarkup = markerMarkup + co + "</B></TD></TR><TR><TD colspan='2'>";
markerMarkup = markerMarkup + streetadd + "</TD></TR><TR><TD colspan='2'>";
markerMarkup = markerMarkup + city + "," + state + " " + zip + "</TD></TR><TR><TD colspan='2'>";
markerMarkup = markerMarkup + phone + "</TD></TR><TR><TD colspan='2'>";
if(website.indexOf("http://")>0) {
markerMarkup = markerMarkup +"<a href=";
} else {
markerMarkup = markerMarkup +"<a href=http://";
}
markerMarkup = markerMarkup + website + " target=_blank>" + website + "</a></TD></TR><TR><TD>";
var funCall = custid + "," + streetadd + "," + city + "," + state + "," + zip + "," + address + "," + phone + "," + website + "," + co;
markerMarkup = markerMarkup + "<input type='button' class='button' value='see available styles' id='styles' onclick='setstyles("+ funCall +");'></input>";
//markerMarkup = markerMarkup + "<input type='button' class='button' value='see available styles' id='styles' onclick='setstyles("+ custid +");'></input>";
markerMarkup = markerMarkup + "</TD></TR></TABLE>";
var marker = new google.maps.Marker({
position: point,
map: map,
icon: image
});
google.maps.event.addListener(marker, "mouseover", function () {
if (infowindowHover) infowindowHover.close();
infowindowHover = new google.maps.InfoWindow({content: hoverText});
infowindowHover.open(map, marker);
});
google.maps.event.addListener(marker, "mouseout", function () {
if (infowindowHover) infowindowHover.close();
});
google.maps.event.addListener(marker, "click", function () {
if (infowindowClick) infowindowClick.close();
infowindowClick = new google.maps.InfoWindow({ content: markerMarkup });
infowindowClick.open(map, marker);
});
//google.maps.event.addListener(marker, "mouseout", function () {
// if (infowindowClick) infowindowClick.close();
//});
return marker;
}
The second function that I want to call from this function is:
function setstyles(idcust,streetadd,city,state,zip,address,phone,website,co){
var msg= "This feature is available only to logged-in ";
alert(idcust);
<%if Session("ctype")="1" then %>
alert(msg + " non wholesalers.");
<%else %>
<%if Session("ctype")="0" then %>
var storestyles = 'storestyles.asp?id=' + idcust;
document.getElementById('storeaddresses').style.display = 'block';
<%else %>
alert(msg + "users.");
<% end if %>
<%end if %>
}
I want to pass the parameters from the createMarker() to the setstyles() which currently I am unable to do.
alert(stremarkerMarkup = markerMarkup + XusemarkerMarkup += X.