Behold:
Part of an ASPX page:
<h3>Content</h3>
<script type="text/javascript" src="Write.aspx.js"></script>
<div id="divTxaTools"></div>
<textarea cols="120" rows="20" id="txaContent" runat="server"></textarea>
The referenced ECMAScript file:
var txaTools;
var txaContent;
var btnHeightInc, btnHeightDec, btnWidthInc, btnWidthDec;
window.onload = function() {
txaTools = document.getElementById("divTxaTools");
txaContent = document.getElementById("txaContent");
btnHeightInc = document.createElement("button");
btnHeightDec = document.createElement("button");
btnWidthInc = document.createElement("button");
btnWidthDec = document.createElement("button");
btnHeightInc.innerHTML = "Increase Height";
btnHeightDec.innerHTML = "Decrease Height";
btnWidthInc.innerHTML = "Increase Width";
btnWidthDec.innerHTML = "Decrease Width";
btnHeightInc.type = "button";
btnHeightDec.type = "button";
btnWidthInc.type = "button";
btnWidthDec.type = "button";
btnHeightInc.onclick = HeightIncrease();
btnHeightDec.onclick = HeightDescrease();
btnWidthInc.onclick = WidthIncrease();
btnWidthDec.onclick = WidthDecrease();
txaTools.appendChild(btnHeightInc);
txaTools.appendChild(btnHeightDec);
txaTools.appendChild(btnWidthInc);
txaTools.appendChild(btnWidthDec);
}
function HeightIncrease() {
txaContent.Rows = txaContent.Rows + 1;
}
function HeightDescrease() {
txaContent.Rows = txaContent.Rows - 1;
}
function WidthIncrease() {
txaContent.Cols = txaContent.Cols + 1;
}
function WidthDecrease() {
txaContent.Cols = txaContent.Cols - 1;
}
Question:
Why does Firefox 1.5 report no errors and IE6 report it's equivalent of an NRE on line 21 but not on line 16?
Firefox renders the buttons fine, but clicking them causes nothing, no errors show up in the console either.
Thread Closed
This thread is kinda stale and has been closed but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.