作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试发布来自 highcharts 的数据。
point: {
events: {
click: function (e) {
hs.htmlExpand(null, {
pageOrigin: {
x: e.pageX || e.clientX,
y: e.pageY || e.clientY
},
headingText: this.series.name,
maincontentText: Highcharts.dateFormat('%A, %b %e, %Y', this.x) + ':<br/> ' +
this.y + ' visits ' + '<div>'+'<button onclick="posting(this.y)">'+'send report' +'</button>'+'</div>',
width: 200
});
}
}
}
我在单击按钮时调用一个函数,并且我想向它发送数据。我们如何将 this.y
发送到 posting()
函数,以便我们在函数中获取当前点值。 This fiddler在警报中显示未定义
。我怎样才能在那里实现 this.y
值。单击图表中的点,然后单击发送报告按钮,您就会得到我的问题。
最佳答案
使用就可以解决问题
<button onclick="posting('+this.y+')">'+'send report' +'</button>'+'</div>'
而不是
<button onclick="posting(this.y)">'+'send report' +'</button>'+'</div>'
关于javascript - 从 Highcharts 点将数据发布到服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29773873/
我是一名优秀的程序员,十分优秀!