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 412 views
1 answer 457 views
1 answer 249 views
3 answers 336 views
2 answers 298 views
1 answer 315 views
1 answer 246 views
...