2
$.getJSON(service + "/GetJobTags", 
    { tag: "a" }, 
    function(json) {
        $.each(json, function(i,val) { 
            alert(val.Title); 
        }); 
     });

It calls:

http://127.0.0.1:20087/ClientService.svc/GetJobTags?tag=a

This is probably of note, the service is running on a different port to the client application, which is on:

http://127.0.0.1:32017/index.htm

Firefox says HTTP 200 OK but the response data is null (and it highlights in red in Firebug). In IE it works fine, and the server is returning json.

Is this a permissions problem? Do I need to use JSONP?

Sander Rijken
  • 21,376
  • 3
  • 61
  • 85
williamparry
  • 488
  • 1
  • 7
  • 15
  • 1
    Check de first related question here. "getJSON call working on IE 7 but not Firefox 3…" – Shuriken Mar 17 '10 at 23:55
  • funnily enough i had been looking all over the internet and stackoverflow (including the suggested posts) before I posted :) – williamparry Mar 18 '10 at 00:12

1 Answers1

6

The use of different ports is definitely against the Same Origin Policy in Firefox: Source Here

Maybe document.domain helps, I'm not sure: I can't find anything confirming it can help reach across ports as well.

Update: The feedback to this SO question suggests that JSONP or using a proxy server-side script are indeed the only ways to go.

Community
  • 1
  • 1
Pekka
  • 442,112
  • 142
  • 972
  • 1,088