0
這是我的jsfiddle當一個變量中有空間,股利是不可摺疊
http://jsfiddle.net/nvx4tkLt/8/
我noticied,如果變量,它出現了空間,股利是不可摺疊。
例如在jsfiddle中,如果您點擊兄弟首頁div不可摺疊。
當在DIV clciked這是正在執行
$(document).on('click', '.lielement', function() {
var locationname = $(this).attr("id");
if($(this).find('.restListings').length)
$(this).find('.restListings').remove()
else
displayingRestaurantsForLabel(locationname);
});
function displayingRestaurantsForLabel(locationname)
{
showRestaurantDetailsByLocation(restaurantsbylocation,locationname);
}
function showRestaurantDetailsByLocation(response, locationname) {
var responsedata = JSON.stringify(response);
$("#restmenu").find('.restListings').remove();
var ulhtml = $('<ul class="restListings"></ul>');
var divhtml = $('<div class="inner-intit"><sub class="sub">Yours Favorite Restaurant</sub></div>');
divhtml.append('<br>');
for (var i = 0; i < response.length; i++) {
divhtml.append('<li class="grayOut-Rest innerChild"><h6> '+response[i].vendor_name+'</h6></li>');
existingrestaurants.push(response[i].vendor_id);
}
ulhtml.append(divhtml);
$("#restmenu").find('#'+locationname.trim()).append(ulhtml);
}
有誰請讓我知道什麼是問題的代碼?
在此先感謝。
非常感謝你對這個問題的解釋。 – Pawan 2014-09-30 07:11:31