0
以下腳本將檢索用戶所在的當前頁面的URL。僅從變量值檢索整數
$(location).attr('href');
//pure javascript
var pathname = window.location.pathname;
// to show it in an alert window
alert(window.location);
例如,它會檢索以下對我來說:
http://domain.com/Men/000101,en_US,sc.html?src=sale
我會再像只檢索該網址中顯示的數字,所以我會用000101只落得和保存在另一個變量中。問題是每個網址都有不同的大小號碼。這可能嗎?
謝謝!
是否可以使用正則表達式?...發佈一些網址,看看如何創建,請。 – Cyrus