CRM 2011 + Loading a javascript web resource file from another javascript file.


         While writing html pages for CRM we need to call some javascript common web resource files. e.g. sometimes we need json.js file for calling OData requests. The following lines of code will load the required javascript file.

var JScriptWebResourceUrl="../WebResources/new_json2";
var xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
xmlHttp.open("GET",JScriptWebResourceUrl,false);
xmlHttp.send();
eval(xmlHttp.responseText);

Caution: do not use this for Form javascript libraries.

Advertisements

3 thoughts on “CRM 2011 + Loading a javascript web resource file from another javascript file.

      1. Sagar Sekhri

        What do you mean when you say – “do not use this for Form javascript libraries.”

        Onload/ OnSave events?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s