function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
asadimasadim 

Loading external JavaScript packages

Hi,

I have a bunch of JavaScript packages written using dojo and stored on some server. These packages are called com.abc.xyz.pkg# (with folder structure like http://server/~company/moduleX/src/com/abc/xyz/pkg#.js), and I want to include them in a VF page. The following doesn't work:

 

 

			djConfig = {
				parseOnLoad: true,
				baseUrl:'./',
				modulePaths:{'com.abc.xyz':'http://server/~company/moduleX/src/com/abc/xyz'},
				isDebug: false,
				usePlainJson: true
			};

			dojo.require("com.abc.xyz.pkg1");

			function onPageLoadHandler() {
				alert("Page loaded");
			};
			
			dojo.addOnLoad(onPageLoadHandler);

 

The error message is that "com" is undefined. The "Page loaded" message is also never displayed.

Any ideas would be appreciated.