我有一個腳本,用於說明某個元素在特定頁面上時不顯示。下面是我使用的代碼:if語句中的多個鏈接
<script type="text/javascript">
function callOnPageLoad()
{
var url = window.location.href;
if(url == "http://www.exampledomain.com")
{
document.getElementById('rolex').style.display = 'none';
}
}
</script>
不過,我需要多放幾個URL的if語句,什麼是這樣做的正確方法嗎?
非常感謝
[十佳JavaScript的書籍是初學者應該閱讀](http://www.tripwiremagazine.com/2010/03/top-10-best-javascript-books-that-be ginners-should-read.html) – 2011-06-08 10:40:10
該代碼存在很多潛在的問題休,試着在地址欄中使用大寫字母,刪除www,禁用JS等等。 – 2011-06-08 10:45:03