Ajax or Json and Jquery Hitskin_logo Hitskin.com

This is a Hitskin.com skin preview
Install the skinReturn to the skin page

The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.
3 posters

    Ajax or Json and Jquery

    TamDonCo
    TamDonCo
    Forumember


    Posts : 427
    Reputation : 2
    Language : English

    Ajax or Json and Jquery Empty Ajax or Json and Jquery

    Post by TamDonCo October 14th 2016, 4:49 am

    I try to get data from below link , it 's in HTML format . I try to use Ajax or Json but do not work

    please help

    something looks like this

    Code:


    var url = "https://docs.google.com/spreadsheets/d/1zoNeQHv3hx-y2T30zGYmsdjNVGlcSQl0Dh2FGe_CDLk/gviz/tq?tqx=out:html&tq=select+sum(B)+pivot(C)"

    $.getJSON( url, function( data ) {
        console.log(data);
    });

    SLGray
    SLGray
    Administrator
    Administrator


    Male Posts : 51515
    Reputation : 3519
    Language : English
    Location : United States

    Ajax or Json and Jquery Empty Re: Ajax or Json and Jquery

    Post by SLGray October 14th 2016, 5:55 am

    What exactly are you trying to do?



    Ajax or Json and Jquery Slgray10

    When your topic has been solved, ensure you mark the topic solved.
    Never post your email in public.
    TamDonCo
    TamDonCo
    Forumember


    Posts : 427
    Reputation : 2
    Language : English

    Ajax or Json and Jquery Empty Re: Ajax or Json and Jquery

    Post by TamDonCo October 14th 2016, 3:27 pm

    SLGray wrote:What exactly are you trying to do?

    get data from Google Sheet
    Ch@lo Valdez
    Ch@lo Valdez
    Forumember


    Male Posts : 138
    Reputation : 50
    Language : spanish

    Ajax or Json and Jquery Empty Re: Ajax or Json and Jquery

    Post by Ch@lo Valdez October 14th 2016, 5:36 pm

    google allow external call ?

    this is the first step to review
    TamDonCo
    TamDonCo
    Forumember


    Posts : 427
    Reputation : 2
    Language : English

    Ajax or Json and Jquery Empty Re: Ajax or Json and Jquery

    Post by TamDonCo October 14th 2016, 5:41 pm

    Ch@lo Valdez wrote:google allow external call ?

    this is the first step to review

    I am not sure about that, I read last year post , it works .. looks like this

    Code:

        $.ajax({
                    url:url,
                    type: 'GET',
                    success: function(data) { console.log(data); },
                    error: function(error) { console.log(error.statusText); }
            });


    but I try it failed, either I do something wrong OR Google does not allow anymore ???
    Ch@lo Valdez
    Ch@lo Valdez
    Forumember


    Male Posts : 138
    Reputation : 50
    Language : spanish

    Ajax or Json and Jquery Empty Re: Ajax or Json and Jquery

    Post by Ch@lo Valdez October 14th 2016, 6:19 pm

    this way works

    Code:

    var url = 'https://spreadsheets.google.com/feeds/list/o13394135408524254648.240766968415752635/od6/public/values?alt=json-in-script&callback=?';
    jQuery.getJSON(url).success(function(data) {
        console.log('ok'+ data);
        a = data
    }).error(function(message) {
        console.error('error' + message);
    }).complete(function() {
        console.log('completed!');
    });

    and you must read all this

    https://developers.google.com/gdata/samples/spreadsheet_sample
    TamDonCo
    TamDonCo
    Forumember


    Posts : 427
    Reputation : 2
    Language : English

    Ajax or Json and Jquery Empty Re: Ajax or Json and Jquery

    Post by TamDonCo October 14th 2016, 6:42 pm

    Thanks Ch@lo Valdez

    I know that one works but if you have a sheet with BIG data such as 1000 rows, it 's a heavy loading and slow

    If we can use SQL query to filter out what records we need