Closed
Bug 92090
Opened 24 years ago
Closed 24 years ago
Problem with the creation of a dynamic button in a XUL page
Categories
(Core :: XUL, defect)
Tracking
()
People
(Reporter: yledoare, Unassigned)
Details
Hi !
I am a french student and I am realizing a module for the construtct project
(http://cs.aue.auc.dk/construct) in Denmark with mozilla, and I have a problem
with the XUL interface (Bug ?).
With the following code (That resume my problem) , nothing happends when I click
on the "Link" button.
Thanks to report me if it is a bug or not.
Yann Le Doare, University of Esjberg, Denamrark.
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window title="Button Test" id="button-test"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onload="showLinks();">
<script>
function showLinks()
{
var box=document.getElementsByTagName("urlBox").item(0);
var Lien = document.createElement("button");
box.appendChild(Lien);
Lien.label="Link";
Lien.oncommand="window.open('http://www.google.com', null,
'http,width=600,height=300');";
}
</script>
<urlBox
orient="vertical">
</urlBox>
</window>
![]() |
||
Comment 1•24 years ago
|
||
Please look at the errors in the JS console. Are you getting these:
Error: unterminated string literal
Source File: file:///home/bzbarsky/test.xul
Line: 15, Column: 17
Source Code:
Lien.oncommand="window.open('http://www.google.com', null,
Error: showLinks is not defined
?
If you are, change
Lien.oncommand="window.open('http://www.google.com', null,
'http,width=600,height=300');";
to
Lien.oncommand="window.open('http://www.google.com',null,'http,width=600,height=300');";
(no line breaks in the oncommand attribute).
With that change, this XUL works for me fine with linux build 2001-07-23-08.
![]() |
||
Comment 2•24 years ago
|
||
Comments from reporter:
Ok, but I am working on a Winows machine (I have no choice !).
Infact the problem is resolved by / Ian Oeschger
<mailto:oeschger@netscape.com> / at
http://bugzilla.mozilla.org/show_bug.cgi?id=37512 and now it works fine.
Thank you very much for your response.
![]() |
||
Comment 3•24 years ago
|
||
The whole point of XUL is that high-level stuff like this should work the same
on all platforms.
Ian's fix works because it eliminates the line I pointed out that the error was in.
Marking duplicate.
*** This bug has been marked as a duplicate of 37512 ***
Status: UNCONFIRMED → RESOLVED
Closed: 24 years ago
Resolution: --- → DUPLICATE
Updated•24 years ago
|
QA Contact: lchiang → stummala
Updated•15 years ago
|
Assignee: jst → nobody
Component: DOM: Abstract Schemas → XUL
QA Contact: stummala → xptoolkit.widgets
You need to log in
before you can comment on or make changes to this bug.
Description
•