• Login
sketchucation logo sketchucation
  • Login
🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

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 11 Apr 2014, 18:38

    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 11 Apr 2014, 19:13

      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 11 Apr 2014, 20:13

        Yes that is what I expected.

        Which OS did you test?

        1 Reply Last reply Reply Quote 0
        • D Offline
          driven
          last edited by 11 Apr 2014, 20:17

          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
          • D Offline
            Dan Rathbun
            last edited by 13 Apr 2014, 01:23

            @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
            • T Offline
              TIG Moderator
              last edited by 13 Apr 2014, 14:25

              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 13 Apr 2014, 21:15

                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
                1 / 1
                • First post
                  2/7
                  Last post
                Buy SketchPlus
                Buy SUbD
                Buy WrapR
                Buy eBook
                Buy Modelur
                Buy Vertex Tools
                Buy SketchCuisine
                Buy FormFonts

                Advertisement