V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐关注
Meteor
JSLint - a JavaScript code quality tool
jsFiddle
D3.js
WebStorm
推荐书目
JavaScript 权威指南第 5 版
Closure: The Definitive Guide
soooulp
V2EX  ›  JavaScript

光标在印象笔记编辑框,如何取得第一个 title

  •  
  •   soooulp · 2021-03-08 20:26:40 +08:00 · 1319 次点击
    这是一个创建于 1115 天前的主题,其中的信息可能已经有所发展或是发生改变。

    笔记编辑部分也是一个 document 元素,document.title 是“Evernote”,不是网页的标题“印象笔记网页版”,如何获取页面第一个 title

    使用查找 title 元素,编辑框加载后还是显示“Evernote”

    var tit = document.querySelector("title")
    console.log(tit.innerHTML)
    

    3 条回复    2021-03-09 09:11:15 +08:00
    soooulp
        1
    soooulp  
    OP
       2021-03-09 08:59:46 +08:00
    top.document.querySelector
    iikebug
        2
    iikebug  
       2021-03-09 09:09:23 +08:00
    艹,iframe
    iikebug
        3
    iikebug  
       2021-03-09 09:11:15 +08:00
    window.frames[qa-xxxxxxxx].document.querySelector("title")试试?
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3326 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 11:26 · PVG 19:26 · LAX 04:26 · JFK 07:26
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.