Javascript 信息窗口按钮单击不调用函数

Javascript 信息窗口按钮单击不调用函数,javascript,jquery,html,google-maps-api-3,ionic-framework,Javascript,Jquery,Html,Google Maps Api 3,Ionic Framework,我想在谷歌地图标记的信息窗口中点击事件信息窗口。下面是我的代码,但单击事件不调用该函数 function createmarker(map, marker) { var request = $http({ method: "post", url: "example.com", data: { email: localStorage.getItem("email_id") }, headers: { 'Content-Type':

我想在谷歌地图标记的信息窗口中点击事件信息窗口。下面是我的代码,但单击事件不调用该函数

function createmarker(map, marker) {
   var request = $http({
    method: "post",
    url: "example.com",
    data: {
     email: localStorage.getItem("email_id")
    },
    headers: {
     'Content-Type': 'application/x-www-form-urlencoded'
    }
   });

   request.success(function(response) {
    for (i = 0; i < response.length; i++) {

     marker = new google.maps.Marker({
      position: new google.maps.LatLng(response[i].curlat, response[i].curlng),
      map: map,
      animation: google.maps.Animation.DROP
     });

     google.maps.event.addListener(marker, 'click', (function(marker, i) {
      return function() {
       var infowindow = new google.maps.InfoWindow({
        content: "<input type='button' value='View' onclick='joinFunction()'>" + "<input type='button' value='Join' onclick='alert(\"infoWindow\")'>"
       });
       // infowindow.setContent( '<button onclick="viewFunction()">View</button>');
       infowindow.open(map, marker);
      }
     })(marker, i));
    } //for loop close

   }); //http close
  }; //create marker close
  function joinFunction() {

  }
函数createmarker(映射,标记){
var请求=$http({
方法:“张贴”,
网址:“example.com”,
数据:{
电子邮件:localStorage.getItem(“电子邮件id”)
},
标题:{
“内容类型”:“应用程序/x-www-form-urlencoded”
}
});
请求成功(功能(响应){
对于(i=0;i
您可以使用以下设置:

 infowindow.setContent('<input type="button" value="View" onclick="joinFunction()"><input type="button" value="Join" onclick="alert(\"infoWindow\")">');
infowindow.setContent(“”);

它将工作

将事件侦听器放置在函数外部。此时会显示RT消息,但不会调用joinFunction。编辑调用join函数。你把函数放在哪里了?