使用jQuery的空白目标链接

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了使用jQuery的空白目标链接相关的知识,希望对你有一定的参考价值。

  1. /**
  2.  * Convert the links with rel="external"
  3.  *
  4.  * v. 0.1 Updated (07/02/11)
  5.  * - Changed de CSS selector adding the posibility to external wasn't the only string in rel
  6.  * attribute.
  7.  * - Changed de string from "extern" to "external", that's looks more adequate.
  8.  *
  9.  */
  10. function initRelLinks(){
  11. jQuery('a[rel*="external"]').click(function(){
  12. jQuery(this).attr('target', '_blank');
  13. });
  14. }

以上是关于使用jQuery的空白目标链接的主要内容,如果未能解决你的问题,请参考以下文章

jQuery目标空白链接

JavaScript jQuery目标空白链接

JavaScript [jQuery]目标空白链接

jQuery,终极目标u空白链接

jQuery兼容的目标=所有链接的“空白”效果

仍然使用同源策略 为啥 JSON 响应在 https 链接上使用 jquery ajax 是空白的?