Javascrip работает в IE и в Google Hrome, но не работает в Firefox

Lasa

Собственно проблема в заголовке, хотя может это и не javascript не срабатывает, а что-то другое не так.Есть кодHTML:
<div <span>class</span><span>=</span><span>"summary"</span>>
 <table <span>id</span><span>=</span><span>"Table1"</span> <span>class</span><span>=</span><span>"tableSummary"</span>>
 <thead>
 <tr>
 <td <span>class</span><span>=</span><span>"tdHeader"</span>>
 <h2>
 Summary<<span>/</span>h2>
 <<span>/</span>td>
 <<span>/</span>tr>
 <tr>
 <td <span>class</span><span>=</span><span>"lbUsers"</span>>
 Users:
 <<span>/</span>td>
 <td <span>id</span><span>=</span><span>"tdUsers"</span> <span>class</span><span>=</span><span>"tdUsers"</span>>
 <<span>/</span>td>
 <<span>/</span>tr>
 <tr>
 <td>
 Edition:
 <<span>/</span>td>
 <td <span>id</span><span>=</span><span>"tdEdition"</span>>
 <<span>/</span>td>
 <<span>/</span>tr>
 <tr>
 <td>
 Price:
 <<span>/</span>td>
 <td <span>id</span><span>=</span><span>"tdPrice"</span>>
 <<span>/</span>td>
 <<span>/</span>tr>
 <tr>
 <td>
 Domain Registration
 <<span>/</span>td>
 <td <span>id</span><span>=</span><span>"tdDomain"</span>>
 <<span>/</span>td>
 <<span>/</span>tr>
 <tr>
 <td>
 <<span>/</span>td>
 <<span>/</span>tr>
 <tr>
 <td <span>class</span><span>=</span><span>"tdHeader"</span>>
 Cost
 <<span>/</span>td>
 <<span>/</span>tr>
 <tr>
 <td>
 One-time fees
 <<span>/</span>td>
 <td <span>id</span><span>=</span><span>"tdOnetime"</span>>
 $ 0.00
 <<span>/</span>td>
 <<span>/</span>tr>
 <tr>
 <td>
 Monthly Total
 <<span>/</span>td>
 <td <span>id</span><span>=</span><span>"tdMonthly"</span>>
 <<span>/</span>td>
 <<span>/</span>tr>
 <tr>
 <td <span>class</span><span>=</span><span>"tdTotal"</span>>
 Total (no tax)
 <<span>/</span>td>
 <td <span>id</span><span>=</span><span>"tdTotal"</span> <span>class</span><span>=</span><span>"tdTotal"</span>>
 <<span>/</span>td>
 <<span>/</span>tr>
 <tr <span>id</span><span>=</span><span>"trHST"</span>>
 <td <span>id</span><span>=</span><span>"tdHSTn"</span>>
 <<span>/</span>td>
 <td <span>id</span><span>=</span><span>"tdHST"</span>>
 <<span>/</span>td>
 <<span>/</span>tr>
 <tr <span>id</span><span>=</span><span>"trGST"</span>>
 <td <span>id</span><span>=</span><span>"tdGSTn"</span>>
 <<span>/</span>td>
 <td <span>id</span><span>=</span><span>"tdGST"</span>>
 <<span>/</span>td>
 <<span>/</span>tr>
 <tr <span>id</span><span>=</span><span>"trPST"</span>>
 <td <span>id</span><span>=</span><span>"tdPSTn"</span>>
 <<span>/</span>td>
 <td <span>id</span><span>=</span><span>"tdPST"</span>>
 <<span>/</span>td>
 <<span>/</span>tr>
 <<span>/</span>thead>
 <<span>/</span>table>
C# на загрузку страницы
protected void SessionsParametersInit()
 {
 string edition = Request.QueryString["edition"] ?? "unknown";
 int productID = 10000005; // for Imogomail is 10000005

 #region // FOR DEBUG ONLY !!!!!! DELETE AFTER
 edition = "Standard";
 #endregion

 Session["Edition"] = edition;
 Session["Price"] = dsImogo.PriceByEdition(productID, edition).ToString();
 Session["Description"] = dsImogo.DescriptionByEdition(productID, edition);
 Session["Users"] = 1;
 Session["DomainPrice"] = dsImogo.ProductPriceByCode("DomainRegistration"); 
...
функция javascript
<script type="text/javascript" language="javascript">
 function CurrencyFormatted(amount) {
 var i = parseFloat(amount);
 if (isNaN(i)) { i = 0.00; }
 var minus = '';
 if (i < 0) { minus = '-'; }
 i = Math.abs(i);
 i = parseInt((i + .005) * 100);
 i = i / 100;
 s = new String(i);
 if (s.indexOf('.') < 0) { s += '.00'; }
 if (s.indexOf('.') == (s.length - 2)) { s += '0'; }
 s = minus + s;
 return s;
 }

 function updateSummary() {
 var edition = '<%=Session["Edition"]%>';
 var price = '<%=Session["Price"]%>';
 var HST = '<%=Session["HST"]%>';
 var GST = '<%=Session["GST"]%>';
 var PST = '<%=Session["PST"]%>';

 _textbox = document.getElementById("<%=txtNumber.ClientID %>");
 var numUsers = _textbox.value;

 _checkboxN = document.getElementById("<%=checkNewDomain.ClientID %>")
 if (_checkboxN.checked) {
 var domainPrice = '<%=Session["DomainPrice"]%>';
 }
 else {
 var domainPrice = 0.00;
 }

 var xTotal = 0;
 var xHST = 0;
 var xGST = 0;
 var xPST = 0;

 var lineHST = document.getElementById('trHST');
 var linePST = document.getElementById('trPST');
 var lineGST = document.getElementById('trGST');

 tdEdition.innerHTML = edition;
 tdPrice.innerHTML = '$ ' + CurrencyFormatted(price);
 tdUsers.innerHTML = numUsers;
 tdDomain.innerHTML = '$ ' + CurrencyFormatted(domainPrice)

 xTotal = numUsers * parseFloat(price) + parseFloat(domainPrice);

 tdMonthly.innerHTML = '$ ' + CurrencyFormatted(xTotal);
 tdTotal.innerHTML = '$ ' + CurrencyFormatted(xTotal);

 if (parseFloat(HST) > 0) {
 xHST = xTotal * HST / 100;
 tdHSTn.innerHTML = 'HST (' + '<%=Session["HST"]%>' + '%):';
 tdHST.innerHTML = '$ ' + CurrencyFormatted(xHST);
 }
 else {
 xHST = 0;
 lineHST.style.display = "none";
 }

 if (parseFloat(GST) > 0) {
 xGST = xTotal * GST / 100;
 tdGSTn.innerHTML = 'GST (' + '<%=Session["GST"]%>' + '%):';
 tdGST.innerHTML = '$ ' + CurrencyFormatted(xGST);
 }
 else {
 xGST = 0;
 lineGST.style.display = "none";
 }

 if (parseFloat(PST) > 0) {
 xPST = xTotal * PST / 100;
 tdPSTn.innerHTML = 'HST (' + '<%=Session["PST"]%>' + '%):';
 tdPST.innerHTML = '$ ' + CurrencyFormatted(xPST);
 }
 else {
 xPST = 0;
 linePST.style.display = "none";
 }

 tdTotalT.innerHTML = '$ ' + CurrencyFormatted(xTotal + xHST + xGST + xPST);
 }
 window.onload = updateSummary;
Ошибки никакой не выдает, код C# значения из базы возвращает, функция в отладчике (VisualStudio) срабатывает без проблем, но значения в таблице не меняются, остаются пустыми.В приложеном файле - снимок экрана.
4 ответа

Lasa

Ошибки никакой не выдает
"Не верю" © (C Tools->Web Developer->Error Console Ctrl+Shift+J || Firebug->Console)
tdEdition.innerHTML = edition;
->
document.getElementById(<span>"tdEdition"</span>).innerHTML = edition;
/me думает: совсем уже все под M$ IE прогнулись...


Lasa

Спасибо, добавила везде document.getElementById(), теперь работает. А ошибки в Visual Studio никакой не выдавало :( .


Lasa

Lasa,и не выдаст ошибку:)


Lasa

> А ошибки в Visual Studio никакой не выдавало
(C Tools->Web Developer->Error Console Ctrl+Shift+J || Firebug->Console)
Смотрим в Firefox посредством пунктов меню Tools->Web Developer->Error Console Ctrl+Shift+J или Firebug->Console_________________"Helo, word!" - 17 errors 56 warnings