random crashes. bug with my code or with IE? 
Author Message
 random crashes. bug with my code or with IE?

I'm getting random crashes from my code that adds and removes elements.
Because the original code is too long, I've created a sample code that can
reproduce the same problem. Anyone know if this is a bug with my code or
with IE (I use IE6)? The code is below, and to crash IE, keep on clicking on
the Add button...it's a random crash so I've no idea how many times you need
to click. Hold on to the Add button and IE should crash pretty fast...
Thanks

Andrew

<HTML>
<HEAD><SCRIPT Language=VBScript><!--
Dim Table1
Dim count

Public Sub ReCreateTable()
  Table1.RemoveNode true
  Set Table1 = document.CreateElement("<TBody>")
  MainTable.AppendChild(Table1)
End Sub

Public Sub AddTextBoxes()
  ReCreateTable()
  For i = 1 to 10
    AddTextBox()
  Next
End Sub

Public Sub AddTextBox()
   Dim tr
   Dim td
   Dim newTextBox
   Set tr = document.CreateElement("<TR>")
   Table1.AppendChild(tr)
   Set td = document.CreateElement("<TD>")
   tr.AppendChild(td)
   count = count + 1
   Set newTextBox = document.CreateElement("<INPUT Type=Text Name=Text" &
count & " Value="& count & ">")
   td.AppendChild(newTextBox)
End Sub

//--></SCRIPT></HEAD>

<BODY>
<INPUT Type="button" Value="Add" onClick="AddTextBoxes()">
<TABLE id=MainTable><TBODY id=Table0></TBODY></TABLE>
<Script language=vbscript><!--
  Set Table1 = Table0
//--></Script>

</BODY>
</HTML>



Sat, 17 Dec 2005 03:35:22 GMT  
 random crashes. bug with my code or with IE?

Quote:
> I'm getting random crashes from my code that adds and removes elements.
> Because the original code is too long, I've created a sample code that can
> reproduce the same problem. Anyone know if this is a bug with my code or
> with IE (I use IE6)? The code is below, and to crash IE, keep on clicking
on
> the Add button...it's a random crash so I've no idea how many times you
need
> to click. Hold on to the Add button and IE should crash pretty fast...
> Thanks

> Andrew

I just think you're working IE too hard. Tables are one of the most
intensive operations for a browser and it can't cope with the strain.
Perhaps if you used the table specific methods createTBody, insertRow,
insertCell etc. you might get a better result. On my machine (Windows 20000
with 256MB ram) it took very fast clicking of the button over thirty times
to get the browser to crash.
--

Joe



Sat, 17 Dec 2005 16:33:35 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Access OLE Object fields

2. IE 6.0 Crashes (as in Crash) on my JScript Code

3. Random Crashes Using Com in IE

4. I.E. 5.0 Windows Won't Close with VB6 API Code

5. Random crashes

6. Random crash!

7. Random Crashes, all programs

8. - BUG: Latest Security Patch (Q316059) Crashes Internet Explorer When You Call execScript

9. Code to generate random files

10. Code to create a random alpha-numeric password?

11. a firendly compliant..

12. Turbo Pascal for Windows 1.5

 

 
Powered by phpBB® Forum Software