ts文件中动态添加的html文件,如何绑定点击事件?

来源:

慕村2922186

2016-11-25

地图信息窗口创建时,需要传递一段html代码作为窗体的内容,在该窗口中我想用一个button接收点击事件,onclick和(click)都没用,请教老师怎么弄呀?

var infoWindow = new AMap.InfoWindow({
 content: "<div style='font-size: 14px;'>  " + (i + 1) + ". " + d.name +
 "<button onclick='openLink()'" +
 " style='color: #4ba5ea;font-size: 12px;'> 详情</button>" + "</div>"
           + this.createContent(d.type, d.address, d.tel),
 autoMove: true,
 offset: new AMap.Pixel(0, -30),
 closeWhenClickMap: true
});

写回答

1回答

Parry

2016-11-25

openLink的定义写在哪里了?

0
0

Ionic飞速上手的跨平台App开发

以HTML5移动App开发框架Ionic,开发不受平台限制的App

1314 学习 · 640 问题

查看课程