开发者

dynamically changing content of the span element in asp.net mvc 2.0

In my application ,i have a order page which contains products which we can order.If i order a product the CartTotal becomes changed(nothing but the amount is assigned to the span element).If i am not ordering any products the CartTotal will be nothing(span content is nothing) as follows,

Cart Total:

but when i open the order page Cart total will be nothing as shown above.But i need开发者_如何转开发 it as " "Cart is Empty" as follow.

Cart Total: Cart is Empty So my requirement is untill i order atleast one product the cart total is showing that the cart is empty.

So how to do it.my cart total view coding is as follows,

Cart Total: here if i order the product the amount is assigned to span element as

$('#cart-total').text('$' + data.CartTotal.toFixed(2))


<div id="total">
    <strong>Cart is empty</span>
</div>

and then when someone adds a product:

$('#total strong').text('Cart Total: $' + data.CartTotal.toFixed(2));
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜