My application is hosted at: 127.0.0.1:8000
I invoked a jQuery method to load some content into a container (simplified for example):
$('body').load('127.0.0.1:8000/static/views/testing.html');
Upon running this line of code, I’m greeted with an error message:
XMLHttpRequest cannot load %3127.0.0.1:8000/static/views/testing.html. Cross origin requests are only supported for HTTP.
Somewhere along the line, jQuery is mangling the URL and adding “%3”. If I remove the colon, the %3 disappears. This is not a cross-origin problem, as the source and target are both at 127.0.0.1:8000.
Is there some problem that I’m not aware of, inherent to using jQuery.load() with a port specifier in the URL?
I’m running this in Chromium on Ubuntu 12.04 LTS (Version 23.0.1271.97 Ubuntu 12.04 (23.0.1271.97-0ubuntu0.12.04.1))
I am pretty sure that the 1st parameter in the load() function should be a domain-based URL and not an IP address. So if you instead use
$('body').load('http://localhost:8000/static/views/testing.html');, it should work fine.