UNPKG

quicktab

Version:

Multi IFrame tab plugin. operate IFrame like operating browser tabs

41 lines (27 loc) 889 B
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Document</title> </head> <body> <h3>this is welcome page <span id="page"></span> !</h3> <p>(下面的内容是索引,方便观察页面|滚动条高度)</p> <div id="body"></div> <script> for (let index = 0; index < 100; index++) { const div = document.createElement('div') div.textContent = '索引-' + index document.getElementById('body').appendChild(div) } // 获取当前页面的 URL const currentUrl = new URL(window.location.href); // 获取查询参数对象 const params = new URLSearchParams(currentUrl.search); // 获取特定参数的值 const aValue = params.get('page'); document.getElementById('page').innerHTML = aValue </script> </body> </html>