/    Sign up×
Community /Pin to ProfileBookmark

cross origin resource sharing (cors) on iphone (xmlhttprequest)

has anyone managed to get cors* working on the iphone?

i have it working in safari, chrome, ff, and android’s chrome, but iphone’s safari doesn’t work for me. any tricks on getting cors working for iphone?

thanks!
colin

  • * what’s cors? see:
    [url]http://www.nczonline.net/blog/2010/05/25/cross-domain-ajax-with-cross-origin-resource-sharing/#comment-5583[/url]
  • to post a comment
    JavaScript

    2 Comments(s)

    Copy linkTweet thisAlerts:
    @moockauthorMay 31.2010 — update:

    the iphone *simulator* even works, but the (latest) iphone doesn't : /
    Copy linkTweet thisAlerts:
    @moockauthorJun 02.2010 — update:

    I now have a reproducible test showing that iPhone's MobileSafari can successfully send a POST request via JavaScript's XMLHttpRequest, but only to a resource with the same origin as the host page. When the resource has a different origin (i.e., for cross-domain POST requests), no post data is sent to the server. The request's Content-Length header has the value 0.

    Here is the test showing cross-origin requests failing:

    http://moock.org/iphonecors/posttest.html

    Here is the test showing same-origin requests succeeding:

    http://unionplatform.com/xmlhttptest/posttest.html

    All info/comments much appreciated!

    colin
    ×

    Success!

    Help @moock spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.16,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @AriseFacilitySolutions09,
    tipped: article
    amount: 1000 SATS,

    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,
    )...