Refreshing parent window div from child

eileenbat

New Member
I am working on a page where i need to refresh certain div of parent window and here is my use case[*]User click on add to cart button and a pop-up will come with added product details.[*]I am calling a java-script method defined in a JS file which is included in parent window.from that function i am calling a ajax call and want to replace that div content from the content being sent from the server using ajax call and here is the method\[code\]function updateAllotmentQtySection(){ if($('#isProductAllotment').length > 0){ var allotmentEntryCode=$("#allotmentEntryCode").val(); var productcode=$("#productCodePost").val(); $.ajax({ type: "GET", url: "/storefront/cart/getProductedAllotment/?productCode="+productcode+"&allotmentEntryCode="+allotmentEntryCode, success: function(response) { //alert(response); $("#productAllotmentQtyDiv").html(response); } }); }\[/code\]Here is the Div section which i am trying to update\[code\]<div id="productAllotmentQtyDiv"> <c:choose> <c:when test="${not empty productAllotment}"> <select name="qty" id="qty" class="productDetailsSelect"> <c:forEach items="${productAllotmentQty}" var="productAllotmentQty"> <option value="http://stackoverflow.com/questions/12743542/${productAllotmentQty}">${productAllotmentQty}</option> </c:forEach> </select> <input type="hidden" name="allotmentEntryCode" id="allotmentEntryCode" value="http://stackoverflow.com/questions/12743542/${productAllotment.code}" /> <input type="hidden" name="isProductAllotment" id="isProductAllotment" value="http://stackoverflow.com/questions/12743542/true"/> </c:when> <c:otherwise> <c:when test="${not empty editPersonalization}"> <input style="width: 46px;" type="text" size="1" id="qty" name="qty" value="http://stackoverflow.com/questions/12743542/${quantity}" readonly="readonly" /> </c:when> <c:otherwise> <input style="width: 46px;" type="text" size="1" id="qty" name="qty" value="http://stackoverflow.com/questions/12743542/${quantity}" /> </c:otherwise> </c:otherwise> </c:choose> </div>\[/code\]I am sending the same content from the server which i inside the div and even i am able to see the correct response under the alert tag but not sure where exactly is wrong part as the div is not getting updated but only showing the previous values
 
Back
Top