Javascript – Get Part Url

function getPartUrl(part) {
var query = self.location.href;
if( query.indexOf(part) == -1 ){
return false;
}else{
return true;
}

}
//Example
<script>document.write getPartUrl('news.php') ? 1 : 0</script>

source

Leave a Reply