So far I've only noticed this when using jQuery 1.3.1 (minimized).
1) add a breakpoint inside a function,
2) do something that calls that function,
3) when it breaks on the break point, remove the breakpoint and
continue the script
4) try running function again
Sometimes that function will no longer work, but other functions still
work
Sometimes js stops working entirely
Sometime a refresh will fix it, sometimes you have to reboot ff
it seems like you can just open a new window or tab instead of
rebooting ff
Here is code that's causing the problem right now. But I've
experienced this on completely different code (also using jQuery)
Sample HTML after javascript
The break point was set at the last line of reCalcTotal()
function reCalcTotal()
{
var totTaxes = 0;
$("div[id*='tax_']").each
(
function(i)
{
if($(this).attr('id').indexOf('tax_name') == -1)
{
totTaxes += moneyToNumber($(this).html());
}
}
);
var subTotal = moneyToNumber($('#subTotal').html());
var shipping = $('#shippingTotal input').size() > 0 ? 0 :
moneyToNumber($('#shippingTotal').html());
$('#total').html(numberToMoney(Number(totTaxes + shipping +
subTotal)));
}
function moneyToNumber(amt)
{
//amt = String(amt);
//amt = amt.substr(0,amt.lastIndexOf('.') + 2);
amt = amt.replace(/(\.[\d]{2}).*/,'$1');
var amtToRet = Number(amt.replace(/[^\d\.]/g,''))
return amtToRet;
}
function numberToMoney(amt)
{
amt = Number(String(amt).replace(/(\.[\d]{2}).*/,'$1'));
var cents = '.00';
var currencySign = '$';
var delim = ',';
var amtStr = amt % 1 == 0 ? String(amt + cents) : String(amt);
var toRet = '';
amtStr = strrev(amtStr);
toRet = amtStr.replace(/([\d]{3})([\d]{1,3})/,'$1' + delim + '$2');
toRet = strrev(toRet);
return currencySign + toRet;
}
<table cellspacing="0" cellpadding="0" border="0" id="checkout">
<thead>
<tr>
<th class="image"> </th>
<th>Product</th>
<th class="number">Quantity</
th>
<th class="number">Item Cost</
th>
<th class="number">Total</th>
<th/>
</tr>
</thead>
<tbody>
<tr id="item_44">
<td class="image">
<a href="/store/Triumph/
Seats/Sprint_ST_Gel_Seat_Dual_Touring_44.cfm">
<img border="0"
alt="Sprint ST Gel Seat Dual Touring" src="/store/catalog/images/
inventory/small/41_12.jpg"/>
</a>
</td>
<td><a href="/store/
Triumph/Seats/Sprint_ST_Gel_Seat_Dual_Touring_44.cfm">Sprint ST Gel
Seat Dual Touring</a></td>
<td class="number">
<a title="Subtract 1 From
Cart" href="javascript: changeQuantity(44,-1);">
<img border=""
alt="remove" src="../images/icons/subtract.png"/>
</a>
<span
class="quantity">8</span>
<a title="Add 1 To
Cart" href="javascript: changeQuantity(44,1);">
<img border=""
alt="add" src="../images/icons/add.png"/>
</a>
</td>
<td class="number cost">
$239.99</td>
<td class="number total">
$1,919.92</td>
<td><a title="Remove From
Cart" href="javascript: removeFromCheckout(44)"><img border="0"
alt="Remove" src="../images/icons/cancel.png"/></a></td>
</tr>
</tbody>
<tfoot>
<tr id="totals">
<td colspan="3"/>
<td class="topBordered
totals">
<div>SubTotal:</div>
<div>Shipping:</div>
<div
id="tax_name_PST">PST (8%):</div>
<div
id="tax_name_GST">GST (5%):</div>
<div class="theTotal"
style="margin-top: 10px; color: rgb(0, 0, 0);">Total:</div>
</td>
<td class="topBordered
totals">
<div id="subTotal">
$1,919.92</div>
<div id="shippingTotal">
<input type="button" onclick="showLogin()"
value="Please
Log In"/>
</div>
<div id="tax_PST">
$153.59</div>
<div id="tax_GST">
$96.00</div>
<div
class="topBordered theTotal" id="total">$2,169.51</div>
</td>
<td class="topBordered"/>
</tr>
</tfoot>
</table>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Firebug" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/firebug?hl=en
-~----------~----~----~----~------~----~------~--~---