Hi,
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 webserver and called in javascript it showing eeror 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
dataType: "json",
data: {
q: "javascript"
}
}
},
first url data is geting in localhost and works great, second url is not working(but data showing if we run the url in a browser)
it show Error
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
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 webserver and called in javascript it showing eeror 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
dataType: "json",
data: {
q: "javascript"
}
}
},
first url data is geting in localhost and works great, second url is not working(but data showing if we run the url in a browser)
it show Error
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