-2
我需要在這個代碼寫正則表達式來檢測標識上的網址是這樣的:http://example.com/#1
JavaScript網址哈希檢測ID號
var url = "http://example.com/#1";
var id = ; // id naumber (any date after hash 0, 00, 0000...)
if (window.location.hash == "#" + id + "") {
alert("your id is : " + id + "");
}
我不明白你在這裏要做什麼。 – 2012-03-02 18:33:08
另外,不確定jQuery與此有什麼關係,並且在這些字符串連接的末尾不需要「+」「'。 – 2012-03-02 18:36:54
好的..我更新我的代碼 – Abudayah 2012-03-02 18:58:06