PDA

View Full Version : one link brings me to 2 locations


bfly03
05-05-2010, 03:02 PM
ok i am very confused and it is only doing this in IE... (thanks MS)

so when I click on the link below it brings me to index. now on the index page I click view cart (the exact same link) it brings me to the view cart page.

any ideas?

http://www.feelgoodlightups.com/cgi/cart.cgi?viewcart

here i am calling multiple items to the shopping cart with a click and trying to direct them to the view cart cgi.
<script type="text/javascript"><!--
$('.add-items').live('click', function(evt) {
if (evt.button != 0) return;
evt.preventDefault();

var items = $(this).attr('href').substr(1).split(',');

mySuccess();

function mySuccess() {
if (items.length > 0) {
addItemToCart(items.pop());
} else {
top.location.href = 'http://www.feelgoodlightups.com/cgi/cart.cgi?viewcart';
}
}
function addItemToCart(itemId) {
$(this).attr('disabled','disabled');

$.ajax({
url: '/cgi/cart.cgi?'+itemId,
success: mySuccess,
error: function() {
alert('Error occurred. Check the content of your cart.');
location.reload();
},
})
}
});



//--></script>

cheers,