【发布时间】:2019-06-22 13:18:49
【问题描述】:
我正在使用一个 js 画廊(照片滑动),其中一张幻灯片不是图片,但有一些 html。
在那张幻灯片中是对使用onmousedown 提交的表单的事件跟踪,我无法开始工作。
所以我有:
some vars
items.push({ html: '<div and form start etc>
<input type="submit" onmousedown="javascript:_paq.push(["trackEvent" etc ]);_paq.push(["etc"]);_paq.push(["etc"]);">
'});
我是通过摆弄和反复试验来学习的,对于新手问题,我很抱歉。
有什么想法吗?
【问题讨论】:
-
尝试像
[\"trackEvent\" etc ]一样转义内部",如果失败,则移动内联onmousedown 代码并将事件附加到输入中 -
转义不起作用,我会尝试附加到输入 - 你的意思是'oninput'?
-
我已经尝试过 oninput 和 onsubmit 但没有成功 - 我会在问题中添加一些额外的信息
-
在上面的 _paq.push 中添加以下代码可能会很有用:_paq.push(["trackEvent","Blog","Subscribe",location.pathname.substring(1) ]) 是不是 location.pathname.substring 造成了问题?
-
你能展示你逃脱了什么吗?我说inner你刚刚是不是逃过了所有
"的
标签: javascript photoswipe