Advertisement
Guest User

Untitled

a guest
Nov 21st, 2014
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. if(window.location.href.indexOf("name=franky" && "gender=male") > -1)
  2.  
  3. if(window.location.href.indexOf("name=franky") > -1 &&
  4. window.location.href.indexOf("gender=male") > -1)
  5.  
  6. if(window.location.href.indexOf("name=franky") > -1 &&
  7. window.location.href.indexOf("gender=male") > -1)
  8.  
  9. if(window.location.href.indexOf("gender=male") > -1)
  10.  
  11. function CheckIfAllQueryStringsExist(url, qsCollection) {
  12. for (var i = 0; i < qsCollection.length; i++) {
  13. if (url.indexOf(qsCollection[i]) == -1) {
  14. return false;
  15. }
  16. }
  17. return true;
  18. }
  19.  
  20. var myUrl = window.location.href;
  21. var queryStrings = ["name=franky", "gender=male"];
  22. var allPresent = CheckIfAllQueryStringsExist(myUrl, queryStrings);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement