Scripts and stylesheets in head #140
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Is there any way to load in javascript and stylesheets that are included within the <head> tag?
JS
<script>tags should be executed. You can look ateval-script.jsandexecute-scripts.jsto see how it's done.CSS
<style>tags will be inserted into the DOM depending on the switch you use.Hmm, maybe something is wrong my configuration?
I've gotten simple page here:
http://hostonfiber.com/pjax-test/page1.html
It's supposed to change colors when going to the second page and fire a Javascript alert, but neither happen.
In the
<head>tag, you were only switching the<title>tag. Try using"head"instead of"title":Thanks a lot! That helped.
Two more questions:
Failed to execute 'write' on 'Document': It isn't possible to write into a document from an asynchronously-loaded external script unless it is explicitly opened.
Any way around that?
You can see that by going here:
http://hostonfiber.com/pjax-test/page1.html
and clicking Page 3
Edit:
The Flickr script contains the following message:
So you may want to look into other ways of getting the information you need, regardless.
The point of
cacheBustis to force the browser to re-request the page even if it was previously requested and cached, since the URL won't match the one that was cached.Truthfully, I'm not sure why it's enabled by default. The default behavior of browsers is to use the cache.
@MoOx @robinnorth What's the reason
cacheBustis enabled by default?Looks like cache busting has always been the default behaviour of the library, an option to disable it was added in #71.
It may be more sensible to have it disabled by default -- as a breaking change, that would need to happen in the next major or minor release, not in a patch release (i.e. not 0.2.6)
You're right. I'm just trying to understand why it was set up like that to begin with.
@MoOx Do you remember why?
Not really @BehindTheMath :/
Closing in favor of a dedicated issue, #196.