我想隐藏ajax响应div元素。这里是我试过的:如何在成功的ajax响应中隐藏div元素?
<div id="product-options-wrapper" class="product-options"><!--where i am calling ajax-->
new Ajax.Request(url,
{
parameters: {opt_product_id: 22},
onSuccess: function(response) {
// Handle the response content...
if (response.responseText === "1") {
$("showoutofstocknotifbox").show();
alert('it works'); //ajax response successful alert box shows
$$('.product-options-bottom').hide(); //should hide a div element
} else {
$("showoutofstocknotifbox").hide();
}
},
});
</div>
<div class="product-options-bottom"><!--trying to hide on ajax success--></div>
但这无能为力。我正在使用原型JavaScript。 如何通过更正或修改上述(javascript)代码来实现此目的?
感谢您的时间。
是你是正确的先生。 –