How can I use locally installed javascript libraries in an App Designer uihtml component?
I managed to successfully run the code below with the MATLAB web browser.
But it's not possible to get the same result in a uihtml figure. No warning or error.
I hoped that the javascript interpreter is the same…
Examples like the Code MATLAB Response to Data Change in JavaScript from https://www.mathworks.com/help/matlab/ref/uihtml.html are working.
jquery_example.html:
<!DOCTYPE html><html lang="en"><head> <meta charset="utf-8"> <title>jQuery Document Ready Demo</title> <script type="text/javascript" src="{LOCAL PATH TO INSTALLATION FOLDER}\jquery.min.js"></script> <script> $(document).ready(function(){ $("p").text("Hello World!"); }); </script></head><body> <p>Not loaded yet.</p></body></html>
uihtml mockup code:
fig = uifigure('Position',[561 497 333 239]);h = uihtml(fig);h.HTMLSource = 'jquery_example.html'
Best Answer