I grab a href value like this:
var $url = jQuery('body').find('.download a').attr('href');
How to I sanitize this value? I tried adding .text()
but didn't work.
I grab a href value like this:
var $url = jQuery('body').find('.download a').attr('href');
How to I sanitize this value? I tried adding .text()
but didn't work.
There are plenty of things you need consider depending on where you need to use $url
.
This link is very useful, apply principals as you read
I'm sure the above link provides either a fundamental knowledge or checklist for every JS engineer trying to create secure software.