简体   繁体   English

onclick =“ javascript:javascript:function(value);”是什么意思?

[英]What is meant by onclick = “javascript: javascript: function(value);”?

I know this - onclick = "javascript: function(value);" 我知道onclick = "javascript: function(value);" . what is the purpose of writing javascript twice as in 写两次javascript的目的是什么

onclick = "javascript: javascript: function(value);" ?

please help. 请帮忙。

There is no good reason to include the "javascript" protocol. 没有充分的理由包括“ javascript”协议。 It is most likely an error. 这很可能是错误。

I would also mention that you should consider attaching click events using DOM APIs. 我还要提到,您应该考虑使用DOM API附加点击事件。 For example: 例如:

document.getElementById('el').addEventListener('click', function(value) {...});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在 JavaScript 中,“function 表达式始终是一个常数值”是什么意思? - In JavaScript what is meant by 'a function expression is always a constant value'? onClick =“ javascript:function('value')'”和onClick =“” function('value');“有什么区别? - What is the difference between onClick=“javascript: function('value')'” and onClick=“function('value');”? javascript中的obj ['']是什么意思? - What is meant by obj[''] in Javascript? 链接的 href 中的 javascript:// 是什么意思 - What is meant by javascript:// in the href of a link 什么是变量“外部”意味着在javascript中 - what is variable “external” meant for in javascript JavaScript中操作的“上下文”是什么意思 - What is meant by the 'context' of an operation in JavaScript JavaScript 中的外部源是什么意思? - What is meant as by an external source in JavaScript? “解决”是什么意思,谈到JavaScript函数范围内的变量? - What is meant by 'resolved', speaking of variables in a JavaScript function's scope? 使用 javascript .onclick 函数的正确方法是什么? - What is the correct way to use the javascript .onclick function? 在Javascript中使用onClick函数有什么问题? - What is the problems of using onClick function in Javascript?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM