XhstormR
V2EX  ›  问与答

百度在线输入法的 js 文件怎么变成书签模式???

  •  
  •   XhstormR · Jul 14, 2015 · 4141 views
    This topic created in 3960 days ago, the information mentioned may be changed or developed.
    这是百度在线输入法的一个示例网站 http://shurufa.baidu.com/html/demo_simple.html
    查看源代码,里面用了<script type="text/javascript" src="http://www.baidu.com/olime/bdime_open.js"></script>,js文件就是 http://www.baidu.com/olime/bdime_open.js ,怎么改呢。

    就像妈妈计划2一样也是js文件用书签加载 http://zythum.sinaapp.com/mama2/

    跪求啊
    7 replies    2015-07-18 06:23:44 +08:00
    caomu
        1
    caomu  
       Jul 14, 2015
    像这样? https://jsbin.com/hulomokabe 改一下uri不就得了嘛
    XhstormR
        2
    XhstormR  
    OP
       Jul 14, 2015
    @caomu 我看你给出的书签网址的模版跟妈妈计划的模版一样,之前我也是这样套过来的,也能用,只是不知道还有什么更好的写法。请问这是标准模版吗?
    sciooga
        3
    sciooga  
       Jul 14, 2015   ❤️ 1
    新建一个书签 名称自己写 然后网站填:

    javascript:void(function(u,s)%7Bs%3Ddocument.body.appendChild(document.createElement(%27script%27))%3Bs.src%3Du%2B%27%3Fts%3D%27%2BDate.now()%3Bs.charset%3D%27UTF-8%27%7D(%27http://www.baidu.com/olime/bdime_open.js%27))

    像这样:


    顺带提一下,把 http 改成 https 才能适应更多的网站
    regent
        4
    regent  
       Jul 14, 2015
    @sciooga 可用,谢谢
    Septembers
        5
    Septembers  
       Jul 15, 2015
    @sciooga 在你的基础上优化了下

    javascript:void(document.body.appendChild(document.createElement('script')).src='//baidu.com/olime/bdime_open.js')
    sciooga
        6
    sciooga  
       Jul 15, 2015
    @Septembers
    恩,上面是按妈妈计划2写的直接改 url 而已~

    看了下 http://ime.baidu.com/online.html 有 API 调用说明,设定 username 还可以带着词库走。
    aqxdz
        7
    aqxdz  
       Jul 18, 2015
    @sciooga 如何设定 username 还可以带着词库走?直接求脚本!!!
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   891 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 22:30 · PVG 06:30 · LAX 15:30 · JFK 18:30
    ♥ Do have faith in what you're doing.