We Recommend

Pro JavaScript Techniques Pro JavaScript Techniques
Pro JavaScript Techniques is the ultimate JavaScript book for the modern web developer. It provides everything you need to know about modern JavaScript, and shows what JavaScript can do for your web sites. This book doesn't waste any time looking at things you already know, like basic syntax and structures.


Posted By

nicolaspar on 05/30/07


Tagged

get url String querystring query parser leer part


Versions (?)


Who likes this?

1 person has marked this snippet as a favorite

vali29


Javascript - Get Part Url


Published in: JavaScript 


Para marcar navegaciones según la página.

  1. function getPartUrl(part) {
  2. var query = self.location.href;
  3. if( query.indexOf(part) == -1 ){
  4. return false;
  5. }else{
  6. return true;
  7. }
  8.  
  9. }
  10. //Example
  11. <script>document.write getPartUrl('news.php') ? 1 : 0</script>

Report this snippet 

You need to login to post a comment.