Javascript / jQuery $ .get(url)标题解析不工作

即使以下工作: http : //jsfiddle.net/N7D5r/

我尝试使用相同的代码无法正确获取标题 。 无论出于何种奇怪的原因,它们都返回null

      $(document).ready(function(){ // Act on each link $('a').each(function(eachIteration){ // Store current link's url var url = $(this).attr("href"); $.get(url, function(response){ alert("This is the url: " + url); if (((/(.*?)/m).exec(response)) != null) alert("This would be the title: " + (/<title>(.*?)/m).exec(response)[1]); else alert("title was null"); }); }); });  <title>test   

Javascript link

 Misc. Link and what else... jQuery Bookmarklet Link

Some anchor link test.

有任何想法吗?


注意:这个问题是对这里堆栈溢出问题的跟进: jQuery不能$(…)。load()Chrome中的头部标题

This is the url: /users/recent/205784 This would be the title: User antimatter15 - Recent - Stack Overflow This is the url: /about This would be the title: About - Stack Overflow This is the url: /faq This would be the title: FAQ - Stack Overflow This is the url: /users/205784/antimatter15

你的代码似乎工作。 可能是链接超出了当前域并违反了同源策略?