Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fixtures with absolute URL still throw errors #116

Open
EricaSmith opened this issue Feb 21, 2012 · 0 comments
Open

Fixtures with absolute URL still throw errors #116

EricaSmith opened this issue Feb 21, 2012 · 0 comments

Comments

@EricaSmith
Copy link

I am using the stand-alone version of fixtures linked to from here:
http://jupiterjs.com/news/ajax-fixtures-plugin-for-jquery

In most cases, this is working as intended. For example:
$.ajax({
url : "../myJsonService",
dataType: "json",
fixture: "fixtures/fakeJsonService.json",
success : function(msg, textStatus, jqXHR) {
alert("Succeeded in loading data: " + textStatus + " " + errorThrown);
},
error : function(jqXHR, textStatus, errorThrown) {
alert("Failed to load data: " + textStatus + " " + errorThrown);
}
});

The fixture library is included, and everything works as expected.

However, if my ajax request points to an absolute URL rather than a relative path, it still seems to try to contact that url.

That is, if this line:
url : "../myJsonService",
is changed to:
url : "http://localhost:8080/myJsonService",
Then the service still gets called and, if the service is unavailable or throws an error, the "error" callback is called.. (Even if I have a valid fixture to take its place).

I would expect that if I have a fixture in place, and fixtures are enabled, then that fixture data would always be returned and the error function would never get called.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant