Forum Discussion
ChayceDuncan2
6 years agoQrew Cadet
If you've copied it exactly as I've coded it above - it is likely working to some extent - but you may have a minor error somewhere. I can confirm that I tested the above in a test app of mine - and the output of a url button does not necessarily have to be a link. Have you opened up the network tab or the console in your browser to see if you are receiving any syntax or network issues?
Additionally - I didn't add anything to the above sample that would actually do anything visual on the screen. It only did the API Calls and then stopped. If you are looking for some kind of 'action' to occur - I would suggest a window.location.reload() so the page just refreshes.
So in the above -
"javascript: {" &
"$.get(' " & $urlD & "',function(data,success) {" &
"console.log(data);" &
"var count = data.getElementsByTagName('numMatches')[0].innerHTML;" &
"console.log(count);" &
"$.get('" & $urlE & "' + count,function(data,success) {" &
"window.location.reload();" &
}); &
"});" &
"}"
Something like that should work
Chayce Duncan | Technical Lead
(720) 739-1406 | chayceduncan@quandarycg.com
Quandary Knowledge Base
Additionally - I didn't add anything to the above sample that would actually do anything visual on the screen. It only did the API Calls and then stopped. If you are looking for some kind of 'action' to occur - I would suggest a window.location.reload() so the page just refreshes.
So in the above -
"javascript: {" &
"$.get(' " & $urlD & "',function(data,success) {" &
"console.log(data);" &
"var count = data.getElementsByTagName('numMatches')[0].innerHTML;" &
"console.log(count);" &
"$.get('" & $urlE & "' + count,function(data,success) {" &
"window.location.reload();" &
}); &
"});" &
"}"
Something like that should work
Chayce Duncan | Technical Lead
(720) 739-1406 | chayceduncan@quandarycg.com
Quandary Knowledge Base