Opened 13 years ago

Closed 12 years ago

#2852 closed defect (fixed)

[patch] ContentPane having trouble with commented scripts (<script><!-- ...)

Reported by: guest Owned by: mumme
Priority: high Milestone: 0.9
Component: Dojox Version: 0.4.2
Keywords: dojox, ContentPane Cc:
Blocked By: Blocking:

Description

ContentPane? is not executing scripts that use comments:

<script><!-- ... --></script>

I'm stuck with some generated code that uses this idiom, so making it different is not an option :-)

Attachments (1)

ContentPane.patch (417 bytes) - added by guest 13 years ago.

Download all attachments as: .zip

Change History (7)

Changed 13 years ago by guest

Attachment: ContentPane.patch added

comment:1 Changed 13 years ago by guest

About the patch:

The first replace() removes comments, but leaves their contents. The second replace() removes "" comments. Some people use "-->" to end the comment, and the "" that is left comments out the initial statement of the next script after concatenation.

You may want to make this behaviour optional, since there may be legal cases for html/xml comments inside javascript - specially inside strings.

comment:2 Changed 13 years ago by bill

Owner: changed from bill to mumme

The ContentPane? in dijit will be bare and won't have script execution or CSS mangling, but I'd like Fredrik to port the original ContentPane? to dojox/, and then if he wants to, fix this problem. (Well actually, write a SuperContentPane? or some such name, that extends the original content pane but adds all the advanced features from Dojo 0.4 ContentPane?)

comment:3 Changed 12 years ago by bill

Component: WidgetsDojox

comment:4 Changed 12 years ago by mumme

Status: newassigned

comment:5 Changed 12 years ago by mumme

(In [9803]) Initial checkin of a enhanced ContentPane?, with support for scripts, styles, path adjustments, much like in 0.4, but with some enhancements. Removed the java handler code though (nobody requested it). refs #3594, refs#2852, refs #2040, refs #3217, refs #3738

comment:6 Changed 12 years ago by mumme

Keywords: dojox ContentPane added
Milestone: 0.9
Resolution: fixed
Status: assignedclosed

html comments is stripped from JS code in dojox.layout.ContentPane?. IF you turn on cleanContent.

Please reopen if it still doesn't work

Note: See TracTickets for help on using tickets.