我有兩個URL的如何根據URL顯示和隱藏DIV。在Javascript
url 1 = www.xyz.co.uk/asd.qmd
url 2 = www.xyz.co.uk/asd.qmd?getstep=4#
我想說明一個div(左)當網頁的網址爲www.xyz.co.uk/asd.qmd?getstep=4#
在頁面form.php中我寫了下面的代碼:
<script>
$(function(){
var locate = window.location;
if (locate=="http://localhost/school/form.php") {
$('#left').hide();
} else {
$('#left').show();
}
});
</script>
<body onload="function()">
<div id="left">
aasdsasdfdsgfg
</div>
</body>
爲什麼這不起作用?
確定關於PHP條件......這是愚蠢的...... – jatt 2010-09-24 08:18:17