`;
abstract_list.append(str);
}
});
abstract_list.on("click", "a", function (e) {
e.preventDefault();
$(this).siblings("ul").slideToggle();
});
abstract_list.on("click", "a[href^='#']", function (e) {
e.preventDefault();
var targetId = $(this).attr("href").substring(1);
var targetElement = $("#" + targetId);
$("html, body").animate({
scrollTop: targetElement.offset().top
}, 500);
});
}
function CreateFileDL(value) {
var downloadContainer = $('.filedownload-ul');
var hasFile = false;
for (var i = 1; i <= 3; i++) {
var fileName = value[0][`file_name_${i}`];
var rownum = value[0]['rownum'];
var formatdate = value[0]['formatdate'];
if (value[0][`displayname_${i}`]!= null) {
var displayName = value[0][`displayname_${i}`].split('.')[0];
if (fileName !== '') {
var html = `
`;
downloadContainer.append(html);
hasFile = true;
}
}
}
if (!hasFile) {
$('.filedownload').remove();
}
}
function DownFile(number, rownum, formatdate, fileName) {
var source = "examInfo";
var url = "/news/DownFile";
var form = `
'
`;
$('body').append(form);
window.open('', 'File');
$('#myFile').submit().remove();
}
function CreateKeyWordTag(value) {
var downloadContainer = $('.tagLabel');
var hasTag = false;
if (value[0][`keywordsName`] == '') {
$('.tagLabel').remove();
return false;
}
var tag = value[0][`keywordsName`].split(',');
for (var i = 0; i < tag.length; i++) {
var html = `${tag[i]}`;
downloadContainer.append(html);
hasTag = true;
}
}
//延伸閱讀
function GetExamInfoTop5WithKeyword(keyword,utest) {
$.ajaxSettings.async = false;
var formURL = "/news/GetExamInfoTop5WithKeyword";
var formData = {
utest: utest,
keyword: keyword,
infoCount: 5,
__RequestVerificationToken: $('input[name="__RequestVerificationToken"]').val(),
nows: new Date().getTime()
};
$.ajax({
type: "POST",
url: formURL,
data: formData,
success: function (response) {
console.table('response', response)
if (response.Succ == true) {
var downloadContainer = $('.further-reading-ul');
var obj = JSON.parse(response.contentText)
if (obj.length > 0) {
for (var i = 0; i < obj.length; i++) {
var html = `