0

I have the ajax query

    var url = "http://ISAServer.domain.com/WebSite";

    $.ajax({
        url: url,
        success: function (data) {
            alert('Load Successful');
        },
        error: function (data) {
            alert('error');
            console.log(data);
            console.log(data.readyState);
            console.log(data.status);
            console.log(data.statusText);
            console.log(data.responseText);
        },
        dataType: 'json'
    });

The error callback is called. In order to go through ISA, I use an IPad. Using an IPad, the values returned are not very helpful.

  • [object Object]
  • 0
  • 0
  • error
  • ""

I am fairly sure the issue is a cross domain get request. ISA somehow should redirect me to

"http://internal.domain/WebSite"

But it fails. Things are fine when I do not go through ISA and also make a $.get request from the same domain (fails if I try cross domain, like localhost to server).

I am using ASP.NET MVC-3. I have been unsuccessful implementing relative URL's. They end up in the form

"http://servername/siteName/Controller/ControllerService?query"

When it should be

"http://servername/siteName/ControllerService?query"

So, unless you know how to fix that, relative URL's are not an option (and being we have to go through ISA I seriously doubt it would solve anything). I have a helper method which resolves the current path "http://servername/siteName".

Any tips, ideas suggestions?

P.Brian.Mackey
  • 43,228
  • 68
  • 238
  • 348
  • We solved the issue by having the same domain name inside and outside. company.com/site is used internally and externally. DNS just resolves to different IP addresses. I'll leave the question open for a programmatic solution. – P.Brian.Mackey Oct 04 '11 at 18:40

1 Answers1

0

You can't perform cross-domain ajax requests. Well, there are ways to do it, but the built-in library doesn't allow for it for security reasons.

http://www.ajax-cross-domain.com/ provides a method to do this. I can't vouch for it, as I've never tried it, though.

From the URL above, though: "In client-side javascript, this functionality is not present due to the Same Origin Policy. Though this policy is necessary for a robust security model, programmers are often handicapped in their wish to send and retrieve requests to remote servers."

Thomas Thorogood
  • 2,150
  • 3
  • 24
  • 30