As a newbie I'm trying to understand the differences when showing a simple web page (via a local index.html) and showing it in the dashboard.
Eg. I wanted to create dashboard page which shows me a QR code (with the help of jquery-qrcode). According its instructions this is easy taking its basic.html example, and it works fine.
But not if I'm trying to do it using the UI Template node
Acc. Import JavaScript library into node-red I installed jquery.qrcode.min.js in node-reds local static folder, which is accessible when I retrieve it directly through the browser.
I get Error
TypeError: jQuery(...).qrcode is not a function
This is the code I entered into my template node preceeding the template:
<script type="text/javascript" src="jquery.qrcode.min.js"></script>
<div id="qrcode"></div>
<script>
console.log('QR Generate...');
jQuery('#qrcode').qrcode("this plugin is great");
console.log('QR Generated!');
</script>
And the whole flow so far ...
I'm turning around since 2 days without any success. So I will be very pleased if someone can provide any help.
I don't know what other information would be necessary but I can provide if necessary.
[{"id":"f7973da7.5ec19","type":"ui_template","z":"f0c494.388aab7","group":"d3a5e82d.7f059","name":"msg.payload | trusted","order":1,"width":"5","height":"5","format":"<div ng-bind-html=\"msg.payload | trusted\"></div>","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":500,"y":140,"wires":[[]]},{"id":"9289c93b.63aae","type":"template","z":"f0c494.388aab7","name":"","field":"payload","fieldType":"msg","format":"html","syntax":"mustache","template":"<script type=\"text/javascript\" src=\"jquery.qrcode.min.js\"></script>\n\nHello World\n<div id=\"qrcode\"></div>\n<script>\n $(document).ready(function(){\n console.log('QR Generate...');\n jQuery('#qrcode').qrcode(\"this plugin is great\");\n console.log('QR Generated!');\n });\n</script>\n","output":"str","x":280,"y":140,"wires":[["f7973da7.5ec19"]]},{"id":"b0bbef82.5007b8","type":"inject","z":"f0c494.388aab7","name":"","topic":"","payload":"","payloadType":"str","repeat":"","crontab":"","once":true,"onceDelay":"","x":70,"y":140,"wires":[["9289c93b.63aae"]]},{"id":"d3a5e82d.7f059","type":"ui_group","z":"","name":"www","tab":"2af82f59.888e88","order":2,"disp":false,"width":"35"},{"id":"2af82f59.888e88","type":"ui_tab","z":"","name":"Test","icon":"dashboard","disabled":false,"hidden":false}]
Sorry, I'm not allowed to put more than 2 links ...