#136 enhancement

Element#insert should leave external script tags

Reported by metavida | June 2nd, 2008 @ 06:28 PM | in 1.7

You cannot currently use Element#insert to add a script tag linking to an external file (e.g. with a src attribute).

$(document.body).insert('<script type="text/javascript" src="../test.js"></script>')

There are two related problems that should be addressed:

  1. String#stripScripts should have the option to leave script tags with the src attribute, and Element#insert should use that option.
  2. String#extractScripts should ignore the content of script tags with the src attribute (correct me if this is incorrect behavior).

I'm in the process of writing some tests & will upload them soon.

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

The Prototype JavaScript library.

Shared Ticket Bins

People watching this ticket