What is equivalent of PHP $_SERVER['REQUEST_URI'] in JavaScript

1 Answer

0 votes
var server_request_uri = location.pathname + location.search;
document.write(server_request_uri);
 
/*
run: 
 
/allonpage.com/search.php?q=abc
 
*/

 



answered Jun 21, 2018 by avibootz
edited Jun 21, 2018 by avibootz

Related questions

1 answer 321 views
1 answer 379 views
1 answer 147 views
3 answers 208 views
2 answers 191 views
1 answer 229 views
1 answer 148 views
...