-3
當前如果查詢類型在CRM中有公告,則顯示該查詢類型,但是如果查詢類型沒有公告類型,我希望顯示的公告隱藏起來,但我不確定如何執行此操作,我認爲它可能會成爲別人。請指教。在JavaScript中隱藏div類?
$('#enquirytype').on('click', function (e) { //onlick of professions DD
var selectedVal = $(this).val(); //Variable selectedVal this .value
$.ajax({
type: 'GET', //Get
url: "@Url.Action("GetEnquiryTypeAndAnnoncements", "UnauthEnquiry")", //It goes to the enquiry controller method GetenquiryTypes
dataType: 'json', //Datatypes JSON
data: { SelectedEnquiryType: selectedVal }, //data is SelectedProfession: selectedVal
success: function (json) { //Jquery Parse Json data from server on ajax success
if (json.helptext != undefined && json.helptext != '') {
$('#enquiryTypeHelp').html(json.helptext)
$('#enquiryTypeHelpAlert').show(); ///////
}
else
$('#enquiryTypeHelpAlert').hide(); ///////
var announcement = $('.EnquiryTypeAnnouncement:first').clone();
$('#EnquiryTypeAnnouncements').empty();
$('#enquiryTypeHelp').html(json.helptext);
for (var i in json.announcements) {
var announcementCopy = announcement.clone();
announcementCopy.find(".notification").html(json.announcements[i]);
$(announcementCopy).appendTo($('#EnquiryTypeAnnouncements')).show();
$('#EnquiryTypeAnnouncements').show();
}
和你有測試此?它工作嗎?如果不是,問題究竟是什麼? – ADyson