To reference static files located in your extension folder, you have to use this kind of url:
Note there is also a LoadCSS function available in the Qva namespace, so you can load your css like this:
Qva.LoadScript and Qva.LoadCSS are not documented in the current version of the AJAX API reference in the QlikView SDK.
As of QlikView 10 SR3 they will be included in a vastly improved AJAX API reference.
As an example you would call Qva.LoadScript would be called like:
This takes two parameters the first is the URL to the file you want and the second is the function to call after your script has been loaded (i.e. the function that calls your Qva.AddExtension).
The URL is the path to your QvsViewClient.aspx with two URL parameters public=only and the relative path to the whatever file you bundled in your extension that you want to load. E.g. name=Extensions/extension_name/your_file.ext.
The tricky part is that (at least in the current version) you have to use the path as described above EVEN if your real path is more like "Extensions/Objects/extension_name/your_file.ext (i.e. even if your extension is in the Objects sub directory, you don't include it in the path.
Also you should note that you can also use this path when ever you want to refer to any bundled file. See my fusion charts example in the thread http://community.qlik.com/thread/29376?tstart=0 that shows using this syntax as a parameter to the Fusion Chart function that needs the path to the .swf file.
Qva.LoadScript() for loading javasscripts
Qva.LoadCSS() for loading stylesheets
var content = "<div.........."+
var content = "<div.........";
content += "..........";
content += "..........</div>";
Which impairs the visual representation of the code.
In my HTML-file i can write it as it's supposed to:
My question, is there an equivalent like Qva.LoadHTML() to load an .html-file and adding the content.
If not, what's the best practice for HTML-code?
I know that's not the exact answer you are looking for, but I would say that is where we are today.