const manScode = $('.manScode').text().trim(); const code = ' ' + manScode.slice(2); $.ajax({ type: "GET", url: "https://qt.gtimg.cn/q=" + manScode, data: {}, dataType: "script", cache: "false", success: function () { var data = window[`v_${manScode}`].split('~'), date = '', nCla = '', liText = ''; if (data[31].indexOf('-') == 0) { nCla = 'down'; } else { nCla = 'up'; } date = data[30].substr(0, 4) + '/' + data[30].substr(4, 2) + '/' + data[30].substr(6, 2); liText += `
${data[1]}(${code})
code
${data[3]}
${data[31]}
(${data[32]}%)
${date}
`; setTimeout(function(){ // 获取显示时间的 HTML 元素 const timeElement = document.getElementById('times'); // 每秒更新时间 setInterval(() => { // 获取当前时间并格式化为小时:分钟:秒 const now = new Date(); const hours = now.getHours().toString().padStart(2, '0'); const minutes = now.getMinutes().toString().padStart(2, '0'); const seconds = now.getSeconds().toString().padStart(2, '0'); // 更新显示时间的元素内容 timeElement.textContent = `${hours}:${minutes}:${seconds}`; }, 1000); }, 0); $('.manCode-Gupiao').append(liText); } });