Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5977605
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:23:41+00:00 2026-05-22T21:23:41+00:00

Suppose I have a server at this URL: https://example.com/employee , and its returns JSON

  • 0

Suppose I have a server at this URL: https://example.com/employee, and its returns JSON data. I want to retrieve this data using Jquery on iPhone. I wrote this code :

 $.ajax {
   type: "POST",          
   contentType: "application/json; charset=utf-8",  
   url: "https://example.com/employee",   
   data: "{}",     
   dataType: "json"   
success: function(res) {

}
});

Is this the right way to make this HTTPS request, or I need to do some other authentication also? Currently it does not work on iPhone.

It returns JSON data in Firefox, Chrome, IE, Safari, but it doesn’t return anything on iPhone.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T21:23:42+00:00Added an answer on May 22, 2026 at 9:23 pm

    What are you trying to do is JSON, not JSONP. This restriction is called Same Origin Policy

    Try this

     $.ajax {
       type: "POST",          
       contentType: "application/json; charset=utf-8",  
       url: "https://example.com/employee?callback=?",   
       data: "{}",     
       dataType: "json"   
    success: function(res) {
    
    }
    });
    

    and in that server-side script use something like

    <?php
    
        echo preg_replace("/</i", "", $_GET['callback'])."(".$your_data.")";
    ?>
    

    and it should work 😉

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's suppose I have xml like this one: <Server Active=No> <Url>http://some.url</Url> </Server> C# class
Suppose I have the URL look like: http://www.example.com/category/product/htc/desire , I used $_SERVER['REQUEST_URI'] to get
so suppose my server is located in http://www.example.com I then put a file file.exe
Suppose I have static ip in a subnet that has DHCP server. If i
Suppose I have a stringbuilder in C# that does this: StringBuilder sb = new
I need a certain part of a URL extracted. Example: http://www.domain.com/blog/entry-title/?standalone=1 is the given
For example, take this code: $ch = curl_init($resultSet['url'].?get0=get0&get1=.$get1.&get2=.$get2.&get3=.$get3); This of course, looks very ugly,
I mod_rewrite my pages very similar to how SO does it. I have www.example.com/users/login/
Suppose I have 5 local commits. I want to push only 2 of them
Suppose that after primitive validation of user submitted URL I have the string that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.