-
Maybe Sean was remembering this thread: https://ninox.com/en/forum/technical-help-5ab8fe445fe2b42b7dd39ee7/help-with-select-query-needed-60f6ca6882ef8b12c4ca4c36?page=2.
-
Jacques,
You can no longer use the http() function to access a general web address from the Mac app.
Examples: ninox.com or google.com
You can access google.com from the browser version, but if you try to access ninox.com from the browser you'll get stuck in a loop that's difficult to get out of.
-
If I put this code in a button, it works fine (from a browser, I don't have the desktop application):
var response := http("GET", "https://www.google.com/search?q=test");
Error := response.error;
Text := response.result
note: Error and Text are text fields.
You can try putting this code in a formula. It will show a button and when you click on it, it will launch the same request, but from the JavaScript without going through Ninox:
html("
<button type='button' onclick='loadDoc()'>Request data</button>
<p id='demo'></p>
<script>
function loadDoc() {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function () {
if (this.readyState == 4 && this.status == 200) {
document.getElementById('demo').innerHTML = this.responseText;
}
};
xhttp.open('GET', 'https://www.google.com/search?q=test', true, null, null);
xhttp.send();
}
</script>
");
-
Jacques,
Thank you for your time and effort. I had looked into using fetch() a while back, but I determined that using JavaScript in the html() function was a one-way tunnel as far as the Mac app is concerned. Meaning, when you go that route, you can't send any information back to the Mac app so that you can add information to the database. As far as I know, the only way to get that information into Ninox is through the API and into a cloud database which I might try some time in the future. I imagine there would be quite a performance hit compared to how it worked in the Mac app. I was able to scrape 1000 threads in about 25 minutes using the Mac app and some threads, like this one, had more than one page in it.
For what it's worth, I do this for my own enjoyment and in my spare time. When it gets to the point where I don't enjoy it or I get tired of beating my head against a wall that shows no sign of giving way, I move on to something else more fruitful.