焦点科技股票行情 (焦点科技股票代码是多少)
访客
25
焦点科技股票代码
焦点科技的股票代码是 688303
焦点科技股票行情
// 获取股票行情数据const getStockData = () => {fetch('http://api.example.com/stock/688303').then(res => res.json()).then(data => {// 更新页面数据document.getElementById('current-price').innerHTML = data.current_price;document.getElementById('open-price').innerHTML = data.open_price;document.getElementById('high-price').innerHTML = data.high_price;document.getElementById('low-price').innerHTML = data.low_price;document.getElementById('change-amount').innerHTML = data.change_amount;document.getElementById('change-percent').innerHTML = data.change_percent;document.getElementById('volume').innerHTML = data.volume;document.getElementById('turnover').innerHTML = data.turnover;}).catch(err => {console.error(err);
alert('获取行情数据失败,请稍后再试!');});};// 获取历史行情数据const getHistoricalData = () => {fetch('http://api.example.com/stock/688303/history').then(res => res.json()).then(data => {// 更新页面数据const tbody = document.getElementById('historical-data').tBodies[0];data.forEach(row => {const tr = document.createElement('tr');const td1 = document.createElement('td');const td2 = document.createElement('td');const td3 = document.createElement('td');const td4 = document.createElement('td');const td5 = document.createElement('td');const td6 = document.createElement('td');const td7 =document.createElement('td');td1.innerHTML = row.date;td2.innerHTML = row.open_price;td3.innerHTML = row.high_price;td4.innerHTML = row.low_price;td5.innerHTML = row.close_price;td6.innerHTML = row.volume;td7.innerHTML = row.turnover;tr.appendChild(td1);tr.appendChild(td2);tr.appendChild(td3);tr.appendChild(td4);tr.appendChild(td5);tr.appendChild(td6);tr.appendChild(td7);tbody.appendChild(tr);});}).catch(err => {console.error(err);alert('获取历史行情数据失败,请稍后再试!');});};// 页面加载完成后执行window.addEventListener('load', () => {getStockData();getHistoricalData();});
版权声明:除非特别标注,否则均为本站转摘于网络,转载时请以链接形式注明文章出处。