次のコードを実行しましたが、何かが恋しいです。私にとっては問題ないようです。
window.onload = TitleFieldInit;
function TitleFieldInit() {
var str = document.cookie.split("=")[1];
var space = str.split("=")[1];
space = space.split(";")[0];
alert(space);
// while( space.indexOf('%20' )+1) space = space.replace(/%20/,' ');
if (document.cookie != "") {
document.getElementById("TitleField").innerHTML = "Your Title is : " + space;
}
}
そして、FireFoxでエラーが発生しました。「スペースは未定義です」なぜですか?Chromeでは「UncaughtTypeError:Undefinedのメソッド「split」を呼び出せません」Thxが役立ちます。