在测试 linting Ajax URL 时,我注意到一个奇怪的行为。可以在http://jankrems.de/hashbang/#!/foo.php找到一个简单的技术测试
当我直接 lint http://jankrems.de/hashbang/foo.php时,一切正常:http ://cl.ly/3f3t2c0i3M3t0x2Q1Z3l
当我 lint Ajax-Url http://jankrems.de/hashbang/#!foo.php有一些非常奇怪的输出:http ://cl.ly/3n3e0r1s122Q1L0U033k
我尝试对 Twitter hashbang-Urls 进行 linting,它们得到了正确处理。我使用的代码非常简单。在 index.php 中有一个转发...
<?php
if(isset($_GET['_escaped_fragment_'])) {
Header( "HTTP/1.1 301 Moved Permanently" );
header('Location: /hashbang'.$_GET['_escaped_fragment_']);
die();
}
?>
在 foo.php 中,我只输出 Open Graph 标签...
<!DOCTYPE HTML>
<html prefix="og: http://ogp.me/ns#">
<head>
<meta property="og:title" content="Foo" />
<meta property="og:url" content="http://jankrems.de/hashbang/foo.php" />
<meta property="og:description" content="The foo to go to" />
<meta property="og:image" content="http://tailsmagazines.files.wordpress.com/2009/04/kitten.jpg" />
</head>
</html>
也许我只是瞎了眼,错过了一些明显的东西。