Quantcast
Channel: CRM Development forum
Viewing all articles
Browse latest Browse all 8223

Referencing web resources from the organization form (html) pages.

$
0
0

Hello,

This is a follow-on question to: http://social.msdn.microsoft.com/Forums/en-US/89ef6c80-18d8-4909-a27b-784cc414044c/confusion-over-referencing-link-javascript-files?forum=crmdevelopment

So given my new found understanding I went to try a little fancy coding.

I have ten resources that I will need pretty regularly and they work together so when I need them I need all ten.

I added each as a web resource. I then added a master resource that references the other ten. This way when I want to use this tool I only have to add one reference to the form onload.

So at first my resources were showing 404 in the debug console. Bounced around then was reminded to use path from html page to reference files NOT from master script to referenced scripts. (in this case the HTML page is **NOT** a web resource like my original question above)

So my master file looks like this:

var jqmouse = document.createElement("script");
jqmouse.type = "text/javascript";
jqmouse.src = "/MyOrg/xxxx_/lib/jquery.mousewheel.3.0.6.pack.js";
document.body.appendChild(jqmouse);

My questions are as follows:

1. Is this a bad practice? Should I just add all ten resources and not use the shortcut?

2. I don't like hard coding the Org. If the answer to one is it's OK then I should really use getOrgUniqueName();

Any other considerations / ideas?

Thank You



Viewing all articles
Browse latest Browse all 8223

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>