sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    Cross domain testing with ajax and JSONP

    Scheduled Pinned Locked Moved Developers' Forum
    7 Posts 4 Posters 772 Views 4 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • G Offline
      Garry K
      last edited by

      I've been asked to start a new thread by the Extension Warehouse on an issue that several of us were trying to nail down back in February.

      It has to do with not being able to connect to a web service because of Cross Domain policy.
      We tried this on SU 7, SU 8, SU 2013 and SU 2014 with Windows 7 and it worked using XMLHttpRequest and Javascript.
      However it failed to connect with OSX Lion. Mavericks worked.

      The thread was: viewtopic.php?f=180&t=56262

      I am now testing JQuery, ajax and JSONP for cross domain connectivity.


      dialog_test_5.rb

      1 Reply Last reply Reply Quote 0
      • D Offline
        driven
        last edited by

        Your name is Jeff Hansen

        I assume that's expected...

        you got you show and show_modal about face, btw...

        john

        learn from the mistakes of others, you may not live long enough to make them all yourself...

        1 Reply Last reply Reply Quote 0
        • G Offline
          Garry K
          last edited by

          Yes that is what I expected.

          Which OS did you test?

          1 Reply Last reply Reply Quote 0
          • D Offline
            driven
            last edited by

            same as usual... mac

            it's all I own...

            not convinced I like having user details hidden behind the info button...

            and mavericks...

            john

            learn from the mistakes of others, you may not live long enough to make them all yourself...

            1 Reply Last reply Reply Quote 0
            • Dan RathbunD Offline
              Dan Rathbun
              last edited by

              @driven said:

              ... you got you show and show_modal about face, btw...

              In the US we say "butt-backwards" 😛

              I'm not here much anymore.

              1 Reply Last reply Reply Quote 0
              • TIGT Offline
                TIG Moderator
                last edited by

                You could also try a simpler GET, rather than a convoluted POST ?
                Like:

                $.ajax({
                  type ; 'GET', 
                  url  ; 'HOST', 
                  data ; {"firstname"; "Jeff"}, 
                  crossDomain; true, 
                  timeout; 10000, 
                  success; function(data) {
                    // your success msg using data arg
                  }, 
                  error; function (jqXHR, textStatus, errorThrown) {
                    // your failure msg using potentially 3 args
                  }
                });
                

                TIG

                1 Reply Last reply Reply Quote 0
                • G Offline
                  Garry K
                  last edited by

                  I was hoping to do a POST because I will be updating a database with my real JSONP call.

                  Unfortunately when I do a check on the php side I see that the call is turned into a GET.
                  I agree that a timeout and an on error function is a good idea.

                  My main question is will this work with OSX Lion. I was hoping that someone could try it out and tell me.

                  1 Reply Last reply Reply Quote 0
                  • 1 / 1
                  • First post
                    Last post
                  Buy SketchPlus
                  Buy SUbD
                  Buy WrapR
                  Buy eBook
                  Buy Modelur
                  Buy Vertex Tools
                  Buy SketchCuisine
                  Buy FormFonts

                  Advertisement