dimanche 27 avril 2014

JavaScript - impossible d'actualiser une fenêtre à l'aide de jquery et ajax - Stack Overflow


I have a html page to handle a shopping cart view. I used jquery and ajax to show it in a pop up window. I can display items in the pop up window. I have a delete button in the pop up window, which allows me to delete items from my shopping cart. I want to refresh the pop up window after I click on the delete button. But now, after I click on the delete button, the pop up window disappears and it redirects me to the normal html page. Here is my jquery. loadmodal is a plugin I downloaded from Internet.


$(function(){
$('#cart').off('click.login').on('click.login',function(){

$('body').loadmodal({

id:'cart',
title:'Shopping Cart',
url:'/myproject/cartDisplay/',

});

});
});

My delete code (I am writing my project in django):


def process_request(request):

cart = request.session.get('cart',{})

id=request.urlparams[0]
del cart[id]
request.session["cart"]=cart

return HttpResponseRedirect('/project/cartDisplay/')


I have a html page to handle a shopping cart view. I used jquery and ajax to show it in a pop up window. I can display items in the pop up window. I have a delete button in the pop up window, which allows me to delete items from my shopping cart. I want to refresh the pop up window after I click on the delete button. But now, after I click on the delete button, the pop up window disappears and it redirects me to the normal html page. Here is my jquery. loadmodal is a plugin I downloaded from Internet.


$(function(){
$('#cart').off('click.login').on('click.login',function(){

$('body').loadmodal({

id:'cart',
title:'Shopping Cart',
url:'/myproject/cartDisplay/',

});

});
});

My delete code (I am writing my project in django):


def process_request(request):

cart = request.session.get('cart',{})

id=request.urlparams[0]
del cart[id]
request.session["cart"]=cart

return HttpResponseRedirect('/project/cartDisplay/')

0 commentaires:

Enregistrer un commentaire