This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Custom Javascript - simple Hello World example?
#1
Hi!

I cannot get the "Custom Javascript" tool to function in Wiser for KNX from the menu Scripting > Tools > Edit custom JavaScript

This is the default content of the textfield:

$(function(){

  // your code here
});


Exactly what should I input here to make the js-code run in the web browser when using the Touch3 visualization?


I've tried replacing //your code here with console.log('Hello world') but the browser console reports nothing. Nor does log('Hello world in W4K') log anything to the Wiser for KNX "Logs"...

NB. I have mailed Schneider support (who usually respond within a week) but for two weeks I've received no answer...

Thanks!

Robert
Reply
#2
Custom JS only works in standard visualization, trends and schedulers.
Reply
#3
Aha! I see.

Is there any other method to inject Javascript into a Touch3 visualization in Wiser for KNX? Ideally as a separate .js-file.
Reply
#4
Would it be possible to access the template files for the Touch3 viz and add something like <script src="/path/my-javascript.js"></script> and then update this referenced file occasionally?
Reply
#5
There's no easy way of doing this. What kind of functionality do you want to implement with custom JavaScript?
Reply
#6
I was planning on doing all sorts of things. For example modifying CSS (=styles) and the DOM (=HTML elements), parsing JSON strings to draw simple diagrams, adding tooltips etc. Basically things too complex to maintain unless they can be stored in an external .js-file...
Reply
#7
LM Mosaic supports custom JS/CSS widgets but SE Touch3 does not. There's nothing that we can do about it.
Reply


Forum Jump: