i’m quite new to Dojo, but i am trying to convert an existing javascript interface from pure javascript to Dojo.
i am stucked on the following problem
basically i tryied to convert
<a id="myLink" onclick="myfunction()">bla</a>
function myfunction() {
//some funny code
return false; //To PREVENT default link behaviour
}
to the following
var handle = dojo.connect(dojo.byId('myLink'),'onclick',function (evt) {
evt.preventDefault(); //took from dojo reference
//same code that worked in pure js
});
I cannot figure the problem out. Both Chrome and Firefox don’t fire any error or exception, so i guess, there are no syntax errors.
I tryed to connect that function to a input submit instead of the link and it worked but i need it to be connected to a link….
Maybe i’m just tired, but i swear i can’t see the error…
On your HTML body:
On your HTML header :
More on that here : http://dojotoolkit.org/reference-guide/quickstart/events.html