3
In javascript I can invoke the methods normally, but when using jQuery, it does not work.
Ex.:
<a href="#" onclick="meuMetodo()"> Link </a>
In javascript methods work like this, but in jQuery they don’t.
Explaining better:
in the script part, I declare as follows:
<script...>
$('doc...ready...
function meuMetodo(){
//corpo do metodo
}
</script>
</head>
<body>
<a href="#" onclick="meuMetodo()"> Link </a>
</body>
In javascript, everything works. But this same jQuery syntax isn’t working. There is a different syntax to invoke the methods in jQuery or simply cannot invoke the methods through the HTML elements?
In this way it works, but I would like to call the method through the element, instead of calling the element through the method.
– Arthur Cáceres
Danylo, if you explain the answer better,
+1
:)– Sergio