CSS <style> tags will be inserted into the DOM depending on the switch you use.
JS `<script>` tags should be executed. You can look at [`eval-script.js`](https://github.com/MoOx/pjax/blob/master/lib/eval-script.js) and [`execute-scripts.js`](https://github.com/MoOx/pjax/blob/master/lib/execute-scripts.js) to see how it's done.
CSS `<style>` tags will be inserted into the DOM depending on the switch you use.
It's supposed to change colors when going to the second page and fire a Javascript alert, but neither happen.
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":
const pjax = new Pjax({
selectors: ["head", "#content"]
});
In the `<head>` tag, you were only switching the `<title>` tag. Try using `"head"` instead of `"title"`:
```
const pjax = new Pjax({
selectors: ["head", "#content"]
});
```
With a page that includes an embedded Flickr widget I get this error:
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.
What's the purpose of the cacheBust in the location bar URLs? Is that to work around some type of bug?
Thanks a lot! That helped.
Two more questions:
1) With a page that includes an embedded Flickr widget I get this error:
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
2) What's the purpose of the cacheBust in the location bar URLs? Is that to work around some type of bug?
DEVELOPER WARNING: The Flickr badge code is likely to be deprecated, and we recommend changing to a new method to embed photo as soon as possible. See https://www.flickr.com/api for information on how to access Flickr data. Thanks.
So you may want to look into other ways of getting the information you need, regardless.
1) Take a look at [this SO question](https://stackoverflow.com/questions/24297829/execute-write-on-doc-it-isnt-possible-to-write-into-a-document-from-an-asynchr).
**Edit:**
The Flickr script contains the following message:
>DEVELOPER WARNING: The Flickr badge code is likely to be deprecated, and we recommend changing to a new method to embed photo as soon as possible. See https://www.flickr.com/api for information on how to access Flickr data. Thanks.
So you may want to look into other ways of getting the information you need, regardless.
The point of cacheBust is 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 cacheBust is enabled by default?
2) The point of `cacheBust` is 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 `cacheBust` is 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)
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)
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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.