【问题标题】:How to display the page title of the destination page of a short url in mouseover text?如何在鼠标悬停文本中显示短网址的目标页面的页面标题?
【发布时间】:2011-11-06 17:06:09
【问题描述】:

不仅仅是长网址,而是目标页面的页面标题。

【问题讨论】:

    标签: javascript mouseover onmouseover url-shortener


    【解决方案1】:

    你可以使用title属性

    <a title="page title" href="../fdf/page">Go</a>
    

    【讨论】:

    • Jayantha,你有一个 o 型。不是标题,而是标题 Go
    【解决方案2】:

    你必须做这样的事情(jQuery 虚拟代码):

    $(document).ready(function() {
        $('a').each(function() {
            var page = $.get($(this).attr('href'));
            var title = page.match('/<title>(.*)<\/title>/');
            $(this).attr('title', title);
        })
    })
    

    ...随时编辑和修复此解决方案...

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-01-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多