0

I want to use the pagify.js plugin

I've downloaded the repo from Github and I'm aware of the steps I have to take in order to add this to my own site.

However just to see how it works, I've opened the index page on chrome and inspected the page and errors have already occurred (see image).

enter image description here

  1. What's causing this error
  2. How would I successfully add this plugin to my site, the steps don't seem to be working for me.

Many thanks.

Jordan Miguel
  • 632
  • 1
  • 9
  • 34
  • Are all the file paths correct? – empiric Jul 05 '17 at 16:38
  • yes, I've purposely opened the file from the download straight away, to ensure that no paths have been messed up. – Jordan Miguel Jul 05 '17 at 16:39
  • possible duplicate of https://stackoverflow.com/questions/10752055/cross-origin-requests-are-only-supported-for-http-error-when-loading-a-local – Skam Jul 05 '17 at 16:42
  • Possible duplicate of ["Cross origin requests are only supported for HTTP." error when loading a local file](https://stackoverflow.com/questions/10752055/cross-origin-requests-are-only-supported-for-http-error-when-loading-a-local) – Skam Jul 05 '17 at 16:43

1 Answers1

0

Hey it looks like your having an issue similar to the one described on this page.

"Cross origin requests are only supported for HTTP." error when loading a local file

You're using either file:// or C:/, which stays true to the error message as they are not http://

So you can either install a webserver in your local PC or upload the files to a server somewhere, such as DO or AWS.

Orlando P.
  • 621
  • 3
  • 19
  • If you're curious why Chrome blocks this, imagine I'm a malicious hacker who was able to lure you to my page. Without you knowing, I could access your file system from the browser. – Skam Jul 05 '17 at 16:48
  • I uploaded the files on to the web server for chrome. The initial error is fixed, but there is a new error for my html pages 'failed to load resource: the server responded with a status of 404 (Not Found)' – Jordan Miguel Jul 05 '17 at 17:11
  • 404 means a resource isn't being found. Did you double check that you uploaded all the files ? Or maybe the paths now on the server aren't the same because I see you used just style.css then .jQuery but used ../ for pagify. – Orlando P. Jul 05 '17 at 17:21
  • opened on web server for chrome and it worked! For future reference, could you kindly explain to me why I had to use a server? – Jordan Miguel Jul 05 '17 at 17:41
  • Well as See Dart mentioned it's a policy in Google Chrome for your protection. You can disable it but I suggest not to. Basically it's a safety mechanism so if you load a webpage they cannot access your local system. – Orlando P. Jul 05 '17 at 17:46