08/07/12 14:26:50
>>807
> 書き換えるには
document.write()はその位置に文字を書き込むけど
DOMとかの場合書き込みたい位置を特定したりしないといけないから文脈によるなー
> 読み込み途中のscriptならwrite()を使っておけば
読み込み途中(scriptじゃなくてHTMLね)ならおっけー
>>808-809 >>811
自分はこんな感じの方が好きだze
function ToggleDisplay(id /*, initialDisplay*/) {
var initialDisplay = arguments[1] || "block";
var node = document.getElementById(id);
var cstyle = (typeof getComputedStyle == "function") ?
getComputedStyle(node, null) : node.currentStyle; // >>4 Q10 + IE
node.style.display = (cstyle.display == "none") ? initialDisplay : "none";
}