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 9275979
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T16:43:21+00:00 2026-06-18T16:43:21+00:00

I am trying a to create a simple Jquery mobile application. My set up

  • 0

I am trying a to create a simple Jquery mobile application.
My set up is as follows:

  1. jQuery client is running on localhost:9090/myapp.
  2. My server is running on localhost:9010/paperboy
  3. Since I am on windows, on the server side I am using a simple server creating using “bottle” which is a python micro framework.
  4. The server returns json on request, which I can clearly see in Chrome or Firefox.
  5. I have validated my response and it is a valid JSON.

The problem I am facing is, that I want my client to read the json from the server response.
But since its a crossdomain issue, it is not able to do so.
Here is my ajax code for the client:

$.ajax({
        url: "http://localhost:9010/paperboy/toi",
        type:"GET",
        data:$(this),
        dataType:"jsonp",
        //jsonp:"callback",   no support on the server

        success:function(result){
            console.log("ajax result: " + result);
        },

        error:function(e){
            console.log("Error :" + e);
        }
    });

and my bottle Server code is:

from bottle import route, run, template, response
from paperboy import getToiNews

''' call http://localhost:9010/paperboy/toi in browser'''

@route('/paperboy/:source')
def index(source='All'):
    print "requesting news list for %s" % source
    resultJson = getToiNews()
    response.content_type = "application/javascript"
    return resultJson

run(host='localhost', port=9010)

However on running the application I initially was getting “ajax origin policy error” which soon went away once I added the content type to my server.
Now the ajax call goes through without errors, but always invokes the “error” handler. I have tried various combinations but all in vain. One thing I could not figure out is adding jsonp support to my server.
I appreciate any help in this matter and thank you in advance for all the help.
Thanks.

  • 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-06-18T16:43:22+00:00Added an answer on June 18, 2026 at 4:43 pm

    You said it yourself, since it’s a cross-origin call, by default it’s disallowed by the SOP.

    If you’re in control of the server (and you are), you can use CORS to allow the request. That will work on any modern browser. (Though sadly in the case of IE8 and IE9, you’ll need a jQuery patch to enable use of the Microsoft-specific XDomainRequest object rather than the standard XMLHttpRequest; the jQuery team refuse to put it in the library. IE10 finally adds cross-domain handling to XMLHttpRequest.)

    Alternately, as the response is JSON, you could use the very similar JSON-P instead, which has the advantage of working with all browsers (and without jQuery patches).

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

Sidebar

Related Questions

I'm trying to create a simple chat application with node.js and jQuery but I'm
Possible Duplicate: jquery mobile popup not working? i am trying to create a simple
I am trying to create very simple image browser with jQuery. I am doing
I am trying to create a simple about page that uses JQuery click to
I'm trying to create a very simple jQuery slider; however, to get started, I
I am trying to create simple CRUD application. I have a partial view that
I'm trying to create a simple toggling sidebar using jquery, where it expands and
I'm trying to create a simple RSS reader with Phonegap and jQuery. I am
Trying to make simple jQuery function to create a scrollToTop button that fades in
I'm trying to create a chat application with jQuery without having to using setTimeout

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.