Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.
How-to create WRT widgets with remote code
First of all, put the .js file in a public URL.
In the WRT application the developer can use the following code to load the .js file, put in the <head>
var date = new Date();
The 'd=date.getMilliseconds()' variable is very important because with it, the WRT application doesn't use the cached .js file.
But this cached file could be used to performance, just removing the 'd=date.getMilliseconds()' variable, the WRT application will download the code only at the first time the application is opened.
When to use
The developer can use this code to load anything, external variables for use in the application or the complete application.