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

  • Home
  • SEARCH
  • 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 8101007
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T22:52:47+00:00 2026-06-05T22:52:47+00:00

I have written a code for taking JSON data from a PHP and putting

  • 0

I have written a code for taking JSON data from a PHP and putting to listview, it works great in localhost.
When I put the PHP file in a web server and called in Javascript it showing error and not getting data.

This method I have used:

 var dataSource = new kendo.data.DataSource({
                transport: {
                    read: {
                     
                       //url: "userchk.php",    //this works in localhost  
                       url: "http://example.com/web/userchk.php",  this is not working in localhost 
                       
                        dataType: "json", // JSONP (JSON with padding) is required for cross-domain AJAX
                        data: { //additional parameters sent to the remote service
                            q: "javascript"
                        }
                    }
                },

The first url data is getting in localhost and works great, second url is not working(but data show if we run the url in a browser).

It show an error like this:

XMLHttpRequest cannot load http://example.com/web/userchk.php?q=javascript. Origin http://localhost is not allowed by Access-Control-Allow-Origin.

waiting for a good response

  • 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-05T22:52:49+00:00Added an answer on June 5, 2026 at 10:52 pm

    This may be due to cross domain issue. You need to use datatype:jsonp .. A sample code reading data from ODATA Version 2.0 feed is as following ,

     studentsData = new kendo.data.DataSource(
                {
                    type: "odata",
                    transport: {
                        read: {
    
                            url: "http://server/Service.svc/Students",
                            dataType: "jsonp",
    
                            data: {
                                Accept: "application/json"
                            }
                        }
                    },
                    serverfiltering: false,
                    serverPaging: true,
                    batch: false,
                    pageSize: 10
    
                });
    

    You can read the complete “Kendo UI ListView Control and OData in Windows Phone Application” post.

    Thanks
    @debug_mode

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

Sidebar

Related Questions

I have written this code inside a servlet to delete certain records from three
I have written this code in JavaScript and works perfectly fine when I include
I have a JSON data object and a text/html javascript template written using the
I have written this code: public void reloadDefConfig(File filepath, String fileInJar) { File configFile
I have written a Ruby application which parses lots of data from sources in
I have written an importer which copies data from a flat table into several
I have written code that opens 16 figures at once. Currently, they all open
I have written code in Java to access web cam,and to save image... I
I have written code to perform a function that could take a while to
Hi I have written code like this @Id @Column(nullable=false) @GeneratedValue(strategy=GenerationType.AUTO) public int getUserID() {

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.