從上面你的問題,我剛認識,你需要一段代碼來顯示一些信息您的登錄頁上的查詢字符串received.Following的基礎上,是您可以添加到您的登錄頁面html頁腳的代碼片段(因爲您可以訪問html)。
<script type="text/javascript">
function getParamValue(querystring) {
var qstring = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
for (var i = 0; i < qstring.length; i++) {
var urlparam = qstring[i].split('=');
if (urlparam[0] == querystring) {
return urlparam[1];
}
}
}
if(getParamValue('logout')=='true'){
var messageDiv = document.createElement("div"); // Creating a div to display your message
var message = document.createTextNode("You have successfully logged out."); // Preparing the message to show
messageDiv.appendChild(message); // Appended the message in newly created div
var addIn = document.getElementById("login"); //just presuming there is a div having id="login" in which you want to prepend the message
addIn.insertBefore(messageDiv, addIn.childNodes[0]); //just appended the message on top of login div
//setting style in your message div
messageDiv.style.backgroundColor ="#FF0000";
messageDiv.style.width ="100%";
}
</script>
然後更改登錄頁面的鏈接是這樣的:
http://our.site.com/login.php?logout=true
注意:仔細閱讀代碼中的註釋編輯代碼按你的HTML結構。
請添加一些您試圖使其工作的代碼片段。這樣我們就可以瞭解到你卡在哪兒了。 – Misam