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

From Wiki
Jump to: navigation, search
Article Metadata
Created: mfabiop (27 Jan 2009)
Last edited: hamishwillee (25 Jul 2012)



In this post is showed how to use JavaScript code located in the server side, when developing a WRT application. As showed in the following pictures.


Remote JavaScript

First of all, put the .js file in a public URL.

WRT Code

In the WRT application the developer can use the following code to load the .js file, put in the <head>

var date = new Date();
var script = "\<script type='text/javascript' src='"+date.getMilliseconds()+"'\>\</script\>";

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.

This page was last modified on 25 July 2012, at 10:54.
16 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.


Thank you!

We appreciate your feedback.