Where is the error in this? The prediction does not show.
https://studio.code.org/projects/applab/ytS3cziX-tGJnxioFQmTXlyUbT5aENnOEu5AIex-KHU
Thanks
Where is the error in this? The prediction does not show.
https://studio.code.org/projects/applab/ytS3cziX-tGJnxioFQmTXlyUbT5aENnOEu5AIex-KHU
Thanks
your issue lies within how the html is being assigned in setText, this has nothing to do with getPrediction has a result that is not being output correctly, if this is a student project they could have avoided this issue by naming the output box correctly and not assigning it to the screen id… this is why it’s best practice to name all interface especially ones that you’ll be interacting with frequently
Additionally since all the data was logged within the object there was no need to re-assign such values so i stripped it from the predict button because it would be a redundant call, unless you plan on making all options editable at the end
Here is your revised portion of your code using the correct id and not the screen id
onEvent("button7", "click", function( ) {
setText("text_input1", '');
getPrediction("Zoo Animals", "E1phHKqj7v1c", data, function(value) {
setText("text_input1", value);
});
});
Hope this helps