Closed
Bug 271882
Opened 20 years ago
Closed 20 years ago
script code is displayed if the script element is assigned a display:block style value
Categories
(Core :: Layout: Block and Inline, defect)
Tracking
()
VERIFIED
INVALID
People
(Reporter: simone, Unassigned)
Details
Attachments
(2 files, 2 obsolete files)
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0 If I assigne to a script tag a display:block attribute (<script style="display:block;">) the content of the script is first displayed on the page, than it is executed Reproducible: Always Steps to Reproduce: Look at the testcase for an example Actual Results: Script code is displayed Expected Results: Should just execute
| Reporter | ||
Comment 1•20 years ago
|
||
| Reporter | ||
Comment 2•20 years ago
|
||
I used this thing because I wanted the result of the script to be displayed as block element.
If that's what you want, output something that's display:block.
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → INVALID
| Reporter | ||
Comment 4•20 years ago
|
||
OK, but should not display the "code" of the script. Should display just the results of the scripts.
Status: RESOLVED → UNCONFIRMED
Resolution: INVALID → ---
| Reporter | ||
Comment 5•20 years ago
|
||
This what I see, the code is written on the page
| Reporter | ||
Comment 6•20 years ago
|
||
In this example you see that (maybe in the other it was clear enough) the source of the script is rendered on the page
Attachment #167124 -
Attachment is obsolete: true
Comment 7•20 years ago
|
||
As I understand it, the text of a script only doesn't display because the script
has display:none. When you change it to display:block, the text shows up.
You could try doing document.write("<div>This text is written by a
script</div>"), or something equivalent.Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago → 20 years ago
Resolution: --- → INVALID
| Reporter | ||
Comment 8•20 years ago
|
||
The screenshot of the new page
Attachment #167133 -
Attachment is obsolete: true
| Reporter | ||
Comment 9•20 years ago
|
||
So, in response to comment #7, you are telling me that the the fact that a the code of the script is displayed is just because it has as default display:none?
| Reporter | ||
Comment 10•20 years ago
|
||
Anyway I'll suggest that a script tag cannot have the source displayed on the page
Comment 11•20 years ago
|
||
(In reply to comment #9) > So, in response to comment #7, you are telling me that the the fact that a the > code of the script is displayed is just because it has as default display:none? That's my (albiet limited) understanding of it. You should also note that when you document.write something, the result is _not_ a child of the script, so setting disply:block on the script doesn't affect the thing being written anyway.
Comment 12•20 years ago
|
||
Verified invalid. There's no reason we should prevent the script being displayed if the page author wishes to display it.
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•