有什么方法可以覆盖无法直接编辑的页面标题,只能在页眉中添加 Javascript?
我不能直接编辑的行是:
<title>Title of the page</title>
我能想到的解决这个问题的唯一方法是在我可以通过我的门户后端上传的头文件中插入一个 Javascript 命令。有人告诉我,这接受 Javascript。
感谢您的帮助!
最佳答案
可以设置document.title
:
document.title = "This Is A New Title!";
你可以把它放在 <script>
中几乎可以在任何地方添加标签。
关于javascript - 通过标题覆盖 <title>TITLE</title>,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20548582/