Skip to content

Instantly share code, notes, and snippets.

@t-botz
Created February 10, 2012 01:10
Show Gist options
  • Save t-botz/1785003 to your computer and use it in GitHub Desktop.
Save t-botz/1785003 to your computer and use it in GitHub Desktop.
PageSpeed trim_urls bug
/pages/myMainContent.html
/js/myjs.js
/myPartialContent.html
//do something....
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>test</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
function inject(){
jQuery.get('/myPartialContent.html', function(data) {
jQuery('#injectedContent').html(data);
});
}
</script>
</head>
<body>
<button onclick="inject()">Injection!</button>
<div id="injectedContent"></div>
<div>Some Content</div>
</body>
</html>
<script src="/js/myjs.js" type="text/javascript"></script>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>test</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
function inject(){
jQuery.get('../myPartialContent.html', function(data) {
jQuery('#injectedContent').html(data);
});
}
</script>
</head>
<body>
<button onclick="inject()">Injection!</button>
<div id="injectedContent"><script src="js/myjs.js.pagespeed.jm.Fw8hTlo4Qg.js" type="text/javascript"></script></div>
<!--PROBLEM: error 404 on /pages/js/myjs.js.pagespeed.jm.Fw8hTlo4Qg.js... I need that trim_urls keep the / to make it works!-->
<div>Some Content</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment