i read many documents about this but i couldnt figure out that. I need help about execute another js when button clicked. test.js is my javascript file to execute. And in that file there is a just one line code like "alert("test.js executed!");
In my javascript file my click function is like that.
$("#src").click(function(){
alert("hi");
});
It's working well, i need to execute my "test.js" script. Like this:
$("#src").click(function(){
alert("hi");
$.getScript("javascript/test.js",function(){
})
.success(function(){
alert("success");
})
.error(function (){
alert("Failed to execute script");
});
});
But nothing happens. No errors aswell. How can i execute that script with click ?