在没有页面刷新的情况下在每个页面的标题上显示值

I need to display some value (net amount maintained by a shopping cart and number of items in the cart) on the header of every page. When a new item is added to the cart or deleted or the cart is updated, the updated value should be displayed on the header with no page refresh by the user.

I think, I need to reload the page right after it finishes loading. I tried the following.

<META HTTP-EQUIV="REFRESH"; CONTENT="1";URL=ShoppingCart.php">

but it refreshes the page on every second which is indeed not required. Also tried using header() something like this but it's not suitable header("Location: #");

Is there a way to do so? Any time the cart is updated, it should be reflected on the header of every page without a page refresh?

You should use AJAX. Use jQuery.ajax(). It's very simple, handy and nice!