I'm trying to make a link dynamically using $A.createComponents
but it tends to refresh the page even if I use
javascript:void(0)
Previously this was working fine but in the latest release this is giving a problem.
$A.createComponents([
["aura:html",{
"tag" : "a",
"HTMLAttributes" : {"id":"" ,
"class": "",
"href":"'javascript:void(0);'"
}
}],
["aura:html",{
"tag" : "label",
"body":"",
"HTMLAttributes" : {"id":"" ,
"onclick":""
}
}],
["aura:html",{
"tag" : "span",
"HTMLAttributes" : {"id":"",
"onclick":""
}
}]
],
function(components, status, errorMessage){
if (status === "SUCCESS") {
var a = components[0].get("v.body");
a.push(components[1]);
a.push(components[2]);
components[0].set("v.body", a);
var container = component.find("aaa");
var body = container.get("v.body");
body.push(components[0]);
container.set("v.body", body);
}
else if (status === "INCOMPLETE") {
console.log("No response from server or client is offline.")
// Show offline error
}
else if (status === "ERROR") {
console.log("Error: " + errorMessage);
// Show error message
}
}
);