[removed] get url path

后端 未结 4 1983
借酒劲吻你
借酒劲吻你 2020-12-30 05:44
var url = \'http://domain.com/file.php?id=1\';

or

var url = \'https://domain.us/file.php?id=1\'

or



        
4条回答
  •  情深已故
    2020-12-30 06:12

    In Douglas Crockford's book "JavaScript: The Good Parts", there's a regex for retreiving all url parts. It's on page 66 and you can see it here: http://books.google.ch/books?id=PXa2bby0oQ0C&pg=PA66

    You can copy and paste from here: http://www.coderholic.com/javascript-the-good-parts/

提交回复
热议问题