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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T07:33:53+00:00 2026-06-05T07:33:53+00:00

I built an application which reads data via AJAX from an external website. It

  • 0

I built an application which reads data via AJAX from an external website. It works fine but I found out in another question that if I want to package it for BlackBerry 7, with Webworks or Phonegap, I may need to use something called CORS.

How can I convert my following script to do the same thing except using ‘CORS’?

    <script type="text/javascript">
        $("#page_all").live('pagebeforecreate', function() {
        $.get('http://mysite.com/mobile/data/data_all.php',function(data){
            $('.content').empty();
            $(data).find('market').each(function(){
                var $market = $(this);
                var html = '<div class="data">';                      
                html += '<div data-role="collapsible" data-collapsed="true" data-theme="b"><h3>' + $market.attr('date') + '</h3>';
                html += '</div>';
                $('#result').append(html).trigger( "create" );
                $('#result .loading').remove();
            });                        
        });
        });
    </script>
  • 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-05T07:33:54+00:00Added an answer on June 5, 2026 at 7:33 am

    you are probably hitting the domain (ontariosheep.org) from other domain name, and that brings the cross-domain into the poll.

    CORS is just a way to solve this, and it has to be your server that hosts data_all.php that needs to be set to also have in the response header the property:

    Access-Control-Allow-Origin: *
    

    or, you can use the other common method called JSONP.

    using JSONP method, you call should look like:

    var url = "http://ontariosheep.org/mobile/data/data_all.php";
    $.get(url + "?callback=?", function(data) {
        // your method body     
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've built an application which essentially comes in and out of focus when the
I have an application which is built from command line (ANT) using J2ME Polish.
I have application reads in data from text file. Recently I realized that I
I have built an application which takes photos when you touch the preview. I
I've built an mvc application which contains some jquery code. When I run the
I built a Login application in which I have 3 Windows Log In Windows
I have a custom built application framework written in PHP which I have been
I have an application built using JSF1.2. I have a home page which has
My application is built in two sections. A C# executable which is the front
The company for which I work for has built a large ASP.NET MVC application

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.