Help

How to change Api link Onclick JS?

945 0
cancel
Showing results for 
Search instead for 
Did you mean: 
AD_Ser
4 - Data Explorer
4 - Data Explorer

Hello there

so the title tells its self

var type = "Coupons"
var api_key = "?api_key=123456"
var maxRecords = "&maxRecords=10"
var filterByFormula = "&filterByFormula=%7Bvip_ou_50%7D%3D%2250%222"
var next_page = document.getElementById("next");
var offset = "";
var page_suivante = function () {
    console.log(offset);
    offset = data.offset;
    console.log(offset);
}
page_suivante.onclick = page_suivante;
var url = "https://api.airtable.com/v0/app123456/" + type + api_key + maxRecords + "&offset=" + offset + "&sort%5B0%5D%5Bfield%5D=coupons_id";

as you see i created function to change the link of the offset

var next_page = function () {
    console.log(offset);
    offset = data.offset;
    console.log(offset);
}
page_suivante.onclick = next_page;

What I should do or should add to the code ? Thanks for your help !

0 Replies 0