I was trying to load a json object while using Firebug and jQuerify to inject jQuery code into the website of the currently active tab. If you don’t know what I’m talking about, these are firefox add-ons. Firebug is a great debugging tool whereas jQuerify adds the jQuery library to any website if it’s not yet loaded.

Now some details to my recent problem. If I enter the URL into the browsers location field I get a proper json object back. If I send an XMLHttpRequest to the same URL the server responses with the status code 301 Moved Permanently. Has this issue to do with the Same Origin Policy (SOP) ?

If so I need a workaround because this URL will be the new API URL for some web apps.

Any suggestions what this could be?

Edit:
It wasn’t a SOP problem but I also had to face with such a problem later. The above described behaviour came from a missing / at the end of the URL. Entering such a URL into the location field the browser automatically add the tailing slash if it’s missing. After I found that out I wasn’t able to fetch the json from another domain. It’s been months that I’ve been coding jQuery a lot so I forgot one little but important information. The server has to send an additional header to allow other domains. More about this later in a seperate post.

1 Comment

Unlike the traditional means of marketing, TV, radio, magazines, in the web marketing campaign positioning sites can be much more targeted, with great advantages in terms of investment and gain on investment faced. Using this method will keep you safe from being punished by Google’s strict rules on SEO, and will also mean that what traffic you do get from your SEO work is actually useful and could lead to real sales. There are people who successfully create SEO plans complete with effective strategy, and they are able to get the results they want without hiring an SEO company.