使页面上所有的链接以新窗口形式打开,代码如下, $(document).ready(function(){ $("a[@href^='http']").attr('target','_blank');});