Those links show how to write the code in Javascript.

My question to you was how to write a userdefined javascript function which can be called in the Qt's api. See post 6.

now I know that these functions have to be defined in an html file which is to be included in the source code.