The forum of the forums
Welcome to the Official Support Forum of Forumotion!

To take full advantage of everything offered by our forum, please log in if you are already a member, or join our community if you've not yet.



Create a free forum like this one.

Ajax or Json and Jquery

View previous topic View next topic 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);
});


TamDonCo
Forumember

Posts : 180
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.


SLGray
Administrator
Administrator

Male Posts : 36639
Reputation : 2441
Language : English
Location : United States

http://ztwds.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

TamDonCo
Forumember

Posts : 180
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

Ch@lo Valdez
Forumember

Male Posts : 100
Reputation : 31
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 ???

TamDonCo
Forumember

Posts : 180
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

Ch@lo Valdez
Forumember

Male Posts : 100
Reputation : 31
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

TamDonCo
Forumember

Posts : 180
Reputation : 2
Language : English

http://nhomcho.forummotion.com/

Back to top Go down

View previous topic View next topic Back to top


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