function test()
{
str=window.location;
alert(str);
str=str.replace('/'); //這裏返回什麽,
alert(str);
window.location.str;
}
</script>
<input type="button" value="取消" onclick="test()" class="button" />
妳看看我寫的測試的,應該有助於理解。
//----------------------
replace 方法
返回根據正則表達式進行文字替換後的字符串的復制。
stringObj.replace(rgExp, replaceText)