Ticket #935 (closed defect: fixed)
Error event is fired twice.
| Reported by: | anonymous | Owned by: | anonymous |
|---|---|---|---|
| Priority: | low | Milestone: | 0.9 |
| Component: | General | Version: | 0.3 |
| Severity: | minor | Keywords: | |
| Cc: |
Description
<html>
<head>
<title>Dojo: Hello World!</title>
<!-- SECTION 1 -->
<script type="text/javascript" src="js/dojo/dojo.js"></script>
<!-- SECTION 2 -->
<script type="text/javascript">
// Load Dojo's code relating to widget managing functions
dojo.require("dojo.widget.*");
dojo.require("dojo.io.*");
dojo.require("dojo.event.*");
// Load Dojo's code relating to the Button2 widget
dojo.require("dojo.widget.Button2");
var firstTime = false;
function helloPressed() {
firstTime = true;
dojo.io.bind({
url: 'response.txt',
load: function(type, data, evt){
alert(data);
},
error: function(type, error) {
alert('Error when retrieving data from the server!');
}
});
}
function init()
{
var helloButton = dojo.widget.byId('helloButton');
dojo.event.connect(helloButton, 'onClick', 'helloPressed')
}
dojo.addOnLoad(init);
</script>
</head>
<body>
<button dojoType="Button2" caption="Hello World" widgetId="helloButton"/>
</body>
</html>
The above code produce two alert boxes if the response.txt file is missing, which means the error event is fired twice.
Change History
Note: See
TracTickets for help on using
tickets.