Hybrid View

  1. #1
    Sencha User
    Join Date
    Jun 2010
    Location
    india
    Posts
    13
    Vote Rating
    0
    arunsathyan is on a distinguished road

      0  

    Default Jsonp request is failing for some services

    Jsonp request is failing for some services


    here is my code, it works fine for certain urls
    i have no server side access to these public services
    Code:
     Ext.data.JsonP.request(   {
    
    
       url:"http://money.rediff.com/money1/current_status_new.php?companylist=17023928|17023929&id=1354690151&Rand=0.6305125835351646",
       callbackKey: 'callback',
       success: function(response) {
         alert('Working'); 
         console.log(response);
       },
       failure: function(response) {
         alert('Not working!');
         console.log(response);
       }
     });
    working service
    Code:
    "http://query.yahooapis.com/v1/public/yql?q=select * from xml where url%3D'http%3A%2F%2Fcloud.tfl.gov.uk%2FTrackerNet%2FPredictionDetailed%2FB%2FBST'"
    Failing service (This returns a json response in browser/response tab)
    Code:
    http://money.rediff.com/money1/current_status_new.php?companylist=17023928|17023929&id=1354690151&Rand=0.6305125835351646
    some one please help me in accessing above service, i need to implement cross domain access from native apps
    thanks
    arun

  2. #2
    bricemason's Avatar
    Join Date
    Jan 2008
    Location
    Upstate NY
    Posts
    280
    Vote Rating
    44
    bricemason has a spectacular aura about bricemason has a spectacular aura about bricemason has a spectacular aura about

      0  
    Brice Mason
    Front End Developer
    Modus Create

    @bricemason
    bricemason.com

    Sencha Touch Screencasts
    Vimeo - Sencha Touch Channel

    Github Projects:
    Sencha Cordova Builder enables the automatic creation, building, and running of PhoneGap (Cordova) projects with Sencha Touch.

    Am I Sencha Touch Ready? checks your system to determine what you need to do to start Sencha Touch development. If you're having trouble getting up and running, try this out.

    Sencha Tools Bridge allows Sencha SDK Tools to co-exist with Sencha Cmd on the same system.

  3. #3
    Sencha User
    Join Date
    Jun 2010
    Location
    india
    Posts
    13
    Vote Rating
    0
    arunsathyan is on a distinguished road

      0  

    Default


    thanks bricemason,
    I have checked the thread in detail.
    is there any custom options possible to access data from this type of json service?
    Thanks
    Arun Sathyan

  4. #4
    bricemason's Avatar
    Join Date
    Jan 2008
    Location
    Upstate NY
    Posts
    280
    Vote Rating
    44
    bricemason has a spectacular aura about bricemason has a spectacular aura about bricemason has a spectacular aura about

      0  

    Default


    I'm not sure what you mean. If you decided to go the route of writing your own server-side implementation to access this service, then you'd probably use an ajax proxy. You can review the options for that proxy here:

    http://docs.sencha.com/touch/2-1/#!/...ata.proxy.Ajax

    Brice
    Brice Mason
    Front End Developer
    Modus Create

    @bricemason
    bricemason.com

    Sencha Touch Screencasts
    Vimeo - Sencha Touch Channel

    Github Projects:
    Sencha Cordova Builder enables the automatic creation, building, and running of PhoneGap (Cordova) projects with Sencha Touch.

    Am I Sencha Touch Ready? checks your system to determine what you need to do to start Sencha Touch development. If you're having trouble getting up and running, try this out.

    Sencha Tools Bridge allows Sencha SDK Tools to co-exist with Sencha Cmd on the same system.

  5. #5
    Sencha User
    Join Date
    Jun 2010
    Location
    india
    Posts
    13
    Vote Rating
    0
    arunsathyan is on a distinguished road

      0  

    Default


    thanks again,
    i need to access json service using jsonp request (cross domain).
    Is it possible to implement such a call?
    Existing service is having json response without root element.
    Code:
    [{"CompanyCode":"17023928","LastTradedPrice":"19,580.81","Volume":"0","PercentageDiff":"0.79","FiftyTwoWeekHigh":"19,612.18","FiftyTwoWeekLow":"15,358.02","LastTradedTime":"01 Jan,15:46:30","ChangePercent":"0.79","Change":"154.10","MarketCap":"0.00","High":"19,623.76","Low":"19,508.93","PrevClose":"19,426.71","OpenInterest":"","MarketLot":"","ChangeInOpenInterest":"","Symbol":null},{"CompanyCode":"17023929","LastTradedPrice":"5,950.85","Volume":"0","PercentageDiff":"0.77","FiftyTwoWeekHigh":"5,965.15","FiftyTwoWeekLow":"4,686.85","LastTradedTime":"01 Jan,15:46:37","ChangePercent":"0.77","Change":"45.75","MarketCap":"0.00","High":"5,963.90","Low":"5,935.20","PrevClose":"5,905.10","OpenInterest":"","MarketLot":"","ChangeInOpenInterest":"","Symbol":""}]
    Arun

  6. #6
    bricemason's Avatar
    Join Date
    Jan 2008
    Location
    Upstate NY
    Posts
    280
    Vote Rating
    44
    bricemason has a spectacular aura about bricemason has a spectacular aura about bricemason has a spectacular aura about

      0  

    Default


    A jsonp request is not possible with this service because it's not returning jsonp. It is returning json. Read these docs to learn more about jsonp:

    http://docs.sencha.com/touch/2-1/#!/...ta.proxy.JsonP

    You can solve this using the other ways that I've outlined in the previous threads. Do you have access to your server-side code? If so, what is the platform (PHP, Java, etc)? One way to solve this is to use your server-side code to make requests against the service you want then pass through the results to your client-side code.

    But again, the short answer is that this service you're attempting to use is not returning jsonp so you can't use it that way.

    Brice
    Brice Mason
    Front End Developer
    Modus Create

    @bricemason
    bricemason.com

    Sencha Touch Screencasts
    Vimeo - Sencha Touch Channel

    Github Projects:
    Sencha Cordova Builder enables the automatic creation, building, and running of PhoneGap (Cordova) projects with Sencha Touch.

    Am I Sencha Touch Ready? checks your system to determine what you need to do to start Sencha Touch development. If you're having trouble getting up and running, try this out.

    Sencha Tools Bridge allows Sencha SDK Tools to co-exist with Sencha Cmd on the same system.

Thread Participants: 2

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi