Hi All,
Please find the below code to load the Javascript
Call the Below Function as
LoadWebResource("email.js");
function LoadWebResource(resource) {
var httpRequest = null;
try {
if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari
httpRequest = new XMLHttpRequest();
}
else { // code for IE6, IE5
httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
}
var serverUrl = Xrm.Page.context.getClientUrl();
if (serverUrl.match(/\/$/)) {
serverUrl = serverUrl.substring(0, serverUrl.length - 1);
}
httpRequest.open("GET", serverUrl + "/webresources/" + resource, false);
httpRequest.send(null);
eval(httpRequest.responseText);
}
catch (e) {
alert("LoadWebResource >> Error loading " + resource + ":\n" + e.description);
}
}
Please find the below code to load the Javascript
Call the Below Function as
LoadWebResource("email.js");
function LoadWebResource(resource) {
var httpRequest = null;
try {
if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari
httpRequest = new XMLHttpRequest();
}
else { // code for IE6, IE5
httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
}
var serverUrl = Xrm.Page.context.getClientUrl();
if (serverUrl.match(/\/$/)) {
serverUrl = serverUrl.substring(0, serverUrl.length - 1);
}
httpRequest.open("GET", serverUrl + "/webresources/" + resource, false);
httpRequest.send(null);
eval(httpRequest.responseText);
}
catch (e) {
alert("LoadWebResource >> Error loading " + resource + ":\n" + e.description);
}
}
No comments:
Post a Comment