Advertisement
Guest User

Untitled

a guest
Mar 24th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. http://localhost/40ATV/dashboard.php?page_id=projeto_lista&lista_tipo=equipe
  2.  
  3. dashboard.php?page_id=projeto_lista&lista_tipo=equipe
  4.  
  5. //using a string variable set to the URL you want to pull info from
  6. //this could be set to `window.location.href` instead to get the current URL
  7. var strIn = 'http://localhost/40ATV/dashboard.php?page_id=projeto_lista&lista_tipo=equipe',
  8.  
  9. //get the index of the start of the part of the URL we want to keep
  10. index = strIn.indexOf('/dashboard.php'),
  11.  
  12. //then get everything after the found index
  13. strOut = strIn.substr(index);
  14.  
  15. var a = "http://localhost/40ATV/dashboard.php?page_id=projeto_lista&lista_tipo=equipe";
  16. var cut = a.substr(22);
  17.  
  18. document.write("/" + mySplitResult[mySplitResult.length - 1]);​
  19.  
  20. var str = "http://localhost/40ATV/dashboard.php?page_id=projeto_lista&lista_tipo=equipe";
  21. var arr_split = str.split("/");
  22.  
  23. var num = arr_split.length-1;
  24.  
  25. alert(arr_split[num]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement