" + "" + "\n" + "\n" + "
\n" + "\n" + (data.courseTitle !== '' ? "

" + data.courseTitle + "

\n" : "") + "
\n" + (data.qualType !== '' ? "" + data.qualType + "\n" : "") + "
" + "
\n" + (data.courseCode !== '' ? "

Course Code" + data.courseCode + "

\n" : "" ) + (data.typeOf学习ing !=='' ? "

Type of 学习ing" + data.typeOf学习ing + "

\n" : "") + (data.studyMode !=='' ? "

Study Mode" + data.studyMode + "

\n" : "") + "
\n\n"; $('#shortlist--wrapper').append(shortListItem); counter+=1; $('#counter').html(counter); console.log('UIO_ID' + data.uiO_ID); if(data.uiO_ID!=''){ if(applyAllUrl.endsWith('=')){ applyAllUrl += data.uiO_ID }else{ applyAllUrl += ',' + data.uiO_ID } } $('#apply-all1').attr('href', applyAllUrl); $('#apply-all2').attr('href', applyAllUrl); $('#apply-all1').show(); $('#apply-all2').show(); $('#' + id).on('click', function(){ $('#shortlist-delete').show(); $('#course-to-delete').html(id.trim()); }); } }); } }); } function getCookie(cname) { var name = cname + "="; var ca = document.cookie.split(';'); for(var i = 0; i < ca.length; i++) { var c = ca[i]; while (c.charAt(0) == ' ') { c = c.substring(1); } if (c.indexOf(name) == 0) { return c.substring(name.length, c.length); } } return ""; } function setCookie(cname, cvalue, exdays) { var d = new Date(); d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000)); var expires = "expires="+d.toUTCString(); document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"; } function removeCourseFrom名单1() { alert('Here'); var code = $(this).attr('class').text(); console.log('Removing: ' + code); } $('#shortlist-delete-popup-close,#no-thanks').on('click', function(){ $('#shortlist-delete').hide(); $('#course-to-delete').html(''); }); $('#remove-course').on('click', function(){ $('#shortlist-delete').hide(); var courseCode = $('#course-to-delete').html(); var courses = getCookie('courses'); courses = courses.replace(courseCode + ',',''); setCookie("courses", courses, 365); loadCookies(); });