Appending Script Elements and domManip
Hi All,
On my demo page for my del.icio.us plugin
(http://jqueryjs.googlecode.com/svn/trunk/plugins/delicious/demo.html)
I link directly to jquery-latest.pack.js at S3. When that file moved
to 1.1.4 the demo broke. The problem was that I was using...
$('head').append( objScript );
... to grab the JSON feed from del.icio.us. The error is that the new
version of $().domManip() uses $.ajax() to include scripts when a
script element with a src attribute is detected. This is fine in most
situations, but it will not work for getting anything from a 3rd party
domain (del.icio.us for example). It would also probably intervene and
fail if you were using $().load() to grab some HTML that includes a
script tag that references a different domain as well.
I'm sure this code was added to address an issue with appending real
script elements. It would be easy enough to add a "same host" check to
$().domManip() so that it would ajax local scripts and append script
elements for the others, but I wanted to check here before I started
writing a fix to see if this was broken on purpose. I searched the
google group and didn't find any previous discussion.
Thanks,
Paul
--
"I don't know karate, but I know KA-RAZY!!!!"
-- James Brown