Search code examples
.netektron

Calling external URLs with JS.RegisterJSInclude() in Ektron?


It appears that this is a valid way to use JS.RegisterJSInclude, but all the examples I have found use a local path. I haven't seen any documentation on referring to an external URL. Is there any reason, other than the file being moved that I shouldn't do this?

JS.RegisterJSInclude(this,"http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.0/jquery-ui.min.js","GoogleJQueryUI");

Solution

  • Nope there is no problem doing this. In later versions (v8.5+), we aggregate and minify (on-the-fly) all CSS/JS that has been registered. When you register an external resource ("http://" or "https://"), it just skips the aggregation and minification part. Since most people would do this to access resources on a CDN (like you're doing), it wouldn't be a problem then either.

    In short, this is fine.