0

I'm trying to use jQuery. From jQuery Waypoints I downloaded the example shortcut for infinite scroll. When I checked the web console it gives the following error when it hits the end of the page.

XMLHttpRequest cannot load file:///Users/akash.bansal/Downloads/imakewebthings-jquery-waypoints-415eb55/shortcuts/infinite-scroll/. Received an invalid response. Origin 'null' is therefore not allowed access.`

Edit

Well, that error came because I was accessing a file from a file which got resolved when I allowed the file access in Chrome, but the jQuery-infinite scroll is still not working on localhost!!

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
akash
  • 1,801
  • 7
  • 24
  • 42
  • What error are you getting now? – Miguel Jiménez Aug 22 '14 at 11:09
  • possible duplicate of [Error: "Origin null is not allowed by Access-Control-Allow-Origin" when loading an XML file with JQuery's ajax method](http://stackoverflow.com/questions/5396527/error-origin-null-is-not-allowed-by-access-control-allow-origin-when-loading) – GNi33 Aug 22 '14 at 11:13
  • If you are working on something like localhost/index.html, all the resources are going to be from the localhost root. So if you are trying to pass a file from a system directory like /Users/... then it won't work. This will cause something like localhost/Users/... – Serguei Fedorov Aug 22 '14 at 12:31

1 Answers1

0

Apart from opening Chrome and allow access to the file from other files...

An href link says:

<a href=".">

I changed it to the absolute path. It's working fine for me.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
akash
  • 1,801
  • 7
  • 24
  • 42