turn your easy code to secure code
Install s-event.js with npm
npm install s-event.js --save
in file app.js
require('s-event.js');
in file index.html
<body>
...
<script src="path/app.js"></script>
</body>
Usage :
<a s-click-link="http://www.abc.com">
Open link on current page
</a>
...
<a s-click-fn="test(10)">
do on function
</a>
<script>
function test(number){
console.log(number);
}
</script>
<tagName s-[event]-[type]></tagName>
How it work!
//check resourse code
<a s-click-link="http://www.abc.com">
Open link on current page
</a>
to
<a>
Open link on current page
</a>
//when click will open http://www.abc.com
Here are some related projects