Forum Discussion
_anomDiebolt_
8 years agoQrew Elite
Then you use the IOL technique with this formula text filed:
and this module.js code page:
Notes:
(1) [state] and [limits] are passed to the script module.js as data attributes and read in the script using the dataset property.
[iol] & "module.js" & [/iol]
&
"<a class='QBU_Button Vibrant Success' " &
" data-state='" & [state] & "'" &
" data-limit='" & [limit] & "'" &
">Button</a>"
and this module.js code page:
(function(){
var dbid = "application dbid";
var dbidTable = "table dbid";
var apptoken = "app token";
$.ajaxSetup({data: {apptoken: apptoken}});
$("a.QBU_Button").on("click", function(event) {
console.log("onclick in module.js");
var state = this.dataset.state;
var limit = this.dataset.limit;
console.log("state: ", state);
console.log("limit: ", limit);
var url = "https://developer.nrel.gov/api/alt-fuel-stations/v1.json";
var options = {
fuel_type: "E85,ELEC",
state: state,
limit: limit,
api_key: "MY KEY",
format: "JSON"
}
$.get(url, options).then(function(resp) {
console.log(JSON.stringify(resp, null, " "));
});
});
})();
Notes:
(1) [state] and [limits] are passed to the script module.js as data attributes and read in the script using the dataset property.