defunkt/jquery-pjax — pull request #284 by duzun (2013-06-05 14:01:41+00:00)
Title: Update <meta> and <link> tags on PJAX requests and popstate

An HTML document has at least four components:
1. visible contents (`

`)
2. properties (``, `

`, `<!doctype>`, some `<link>` tags)
3. resources (`<link rel="stylesheet">`, `<link rel=”icon”>`, `<img />`, ...)
4. actions or program logic (`<body>` is loaded from server and replaced into the document at the corresponding position.

2. Some properties of the document are common to the hole web site, but some (like `<title>` and some `<meta>`) are specific to each document/uri. If server is “aware” of PJAX and serves document specific meta information in PJAX responses, PJAX (JS part) should replace this meta information in the document, correspondingly.

3. Some resources are located in `<head>`, some in `<body>` of the document.
The browser takes care of `<body>` resources automatically when the corresponding html code is inserted into `<body>` by PJAX.
Resources from `<head>` should be managed by PJAX JS.
`<link rel="stylesheet">` is an exception and should be managed by JS application (not PJAX), cause it also “contains” program logic (visibility, positioning, transitions etc.) and loading CSS files at PJAX request is against main goal of PJAX (CSS load would occur after PJAX response received).

4. Websites’ program logic is a complex part. PJAX itself is part of websites’ program logic. So, i think PJAX only needs to have a good API to interact with the web application, but is not responsible of loading and running any code on server requests or history state changes outside explicit API interactions.