ics*_*sul 2 javascript jquery google-chrome
我有这个函数,我用 onClick 调用它。在 Google Chrome (Windows) 上可以正常工作,但在 Android Chrome 上则不行。我怎样才能让它在 Android Chrome 中的 ontouch 上工作?
谢谢你!
function copyCupon(cupon, link) {
var copyText = document.createElement("input");
document.body.appendChild(copyText);
copyText.setAttribute("id", "copyTextId");
copyText.setAttribute('value', cupon);
copyText.select();
document.execCommand("copy");
document.body.removeChild(copyText);
alert("Cuponul " + "'" + copyText.value + "'" + " a fost copiat. Spor la cumparaturi! :)");
window.open(link);
}Run Code Online (Sandbox Code Playgroud)
<button onclick="copyCupon('test to copy', 'http://www.google.ro')">Copy coupon</button>Run Code Online (Sandbox Code Playgroud)
尝试这个:
pointer到按钮样式touchstart:$('#whatever').on('touchstart click', function(){ /* 你的代码 */ });
| 归档时间: |
|
| 查看次数: |
3772 次 |
| 最近记录: |