Ajax or Json and Jquery

Go down

Ajax or Json and Jquery

Post by TamDonCo on 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);
});

avatar
TamDonCo
Forumember

Posts : 339
Reputation : 2
Language : English

http://nhomcho.forummotion.com/

Back to top Go down

Re: Ajax or Json and Jquery

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

What exactly are you trying to do?


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

avatar
SLGray
Administrator
Administrator

Male Posts : 43660
Reputation : 3103
Language : English
Location : United States

http://fmthemesdesignteam.forumotion.com/

Back to top Go down

Re: Ajax or Json and Jquery

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

@SLGray wrote:What exactly are you trying to do?

get data from Google Sheet
avatar
TamDonCo
Forumember

Posts : 339
Reputation : 2
Language : English

http://nhomcho.forummotion.com/

Back to top Go down

Re: Ajax or Json and Jquery

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

google allow external call ?

this is the first step to review
avatar
Ch@lo Valdez
Forumember

Male Posts : 138
Reputation : 48
Language : spanish

Back to top Go down

Re: Ajax or Json and Jquery

Post by TamDonCo on 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 ???
avatar
TamDonCo
Forumember

Posts : 339
Reputation : 2
Language : English

http://nhomcho.forummotion.com/

Back to top Go down

Re: Ajax or Json and Jquery

Post by Ch@lo Valdez on 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
avatar
Ch@lo Valdez
Forumember

Male Posts : 138
Reputation : 48
Language : spanish

Back to top Go down

Re: Ajax or Json and Jquery

Post by TamDonCo on 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
avatar
TamDonCo
Forumember

Posts : 339
Reputation : 2
Language : English

http://nhomcho.forummotion.com/

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum