Michael asked:
So having common JavaScript files "in the cloud" and referencing them in your code as absolute urls is becoming more common. Is there a way to have CF point to the EXT-JS files hosted by a third party?
My initial answer to this question was no. I knew that the ajaxImport tag supported a scriptSrc attribute. According to the docs, this specifies a folder, relative to the web root, where the relevant JavaScript files will be loaded.
On a whim though, I tried a full path:
<cfajaximport scriptsrc="http://www.cnn.com/foo/" tags="cfwindow" />
Surprisingly, this not only didn't throw out an error, it actually worked. By "work" of course I mean it used the URL prefix as I set it:
script type="text/javascript" src="http://www.cnn.com/foo/ajax/messages/cfmessage.js"></script>
<script type="text/javascript" src="http://www.cnn.com/foo/ajax/package/cfajax.js"></script>
<script type="text/javascript" src="http://www.cnn.com/foo/ajax/yui/yahoo-dom-event/yahoo-dom-event.js"></script>
<script type="text/javascript" src="http://www.cnn.com/foo/ajax/yui/animation/animation-min.js"></script>
<script type="text/javascript" src="http://www.cnn.com/foo/ajax/ext/adapter/yui/ext-yui-adapter.js"></script>
<script type="text/javascript" src="http://www.cnn.com/foo/ajax/ext/ext-all.js"></script>
<script type="text/javascript" src="http://www.cnn.com/foo/ajax/package/cfwindow.js"></script>
<link rel="stylesheet" type="text/css" href="http://www.cnn.com/foo/ajax/resources/ext/css/ext-all.css" />
<link rel="stylesheet" type="text/css" href="http://www.cnn.com/foo/ajax/resources/cf/cf.css" />
None of these URLs will actually work, but if they did, it looks as if scriptSrc would be an appropriate way to load them. I tend to get a bit anal about not following the CF docs to the letter of the law, but I can't see any reason why Adobe would stop this behavior.
Archived Comments
That's great to hear that it supports external resource locations, it's another 'tool' we can use to help speed up page loads. There's an older (but still awesome) article on the YUI blog about parallel downloads, pretty interesting stuff. http://yuiblog.com/blog/200...