I am developing an ajax web app. I work against FireFox and then test it against IE, normally much later.
The app works fine in FF, all the xmlhttp requests work etc. But when I try it in IE I am just prompted with an "Operation Aborted" message half way into the initial page load. It loads about half of the page and then just fires the message.
Any ideas of how to debug this or determine why it would flag this error?
edit:
This behaviour is present in IE6 and IE7... not just the betas
-
-
yman wrote:I am developing an ajax web app. I work against FireFox and then test it against IE, normally much later.
The app works fine in FF, all the xmlhttp requests work etc. But when I try it in IE I am just prompted with an "Operation Aborted" message half way into the initial page load. It loads about half of the page and then just fires the message.
Any ideas of how to debug this or determine why it would flag this error?
edit:
This behaviour is present in IE6 and IE7... not just the betas
Can you provide a page that will reproduce the problem? Without that it is difficult to know exactly what is causing the problem.
Thanks
-Dave -
DMassy wrote:

yman wrote:I am developing an ajax web app. I work against FireFox and then test it against IE, normally much later.
The app works fine in FF, all the xmlhttp requests work etc. But when I try it in IE I am just prompted with an "Operation Aborted" message half way into the initial page load. It loads about half of the page and then just fires the message.
Any ideas of how to debug this or determine why it would flag this error?
edit:
This behaviour is present in IE6 and IE7... not just the betas
Can you provide a page that will reproduce the problem? Without that it is difficult to know exactly what is causing the problem.
Thanks
-Dave
Yeah, I know, sorry. I cant really release it yet, since it is in development. I will run fiddler, see where it is failing.
-
Well it appears that the problem is triggered by certain behaviours in relation to elements being appended to the dom.
The following html/js will flag an operation aborted error: (tested in IE7 beta 3)
<table>
<tr>
<td>
<script type="text/javascript">
var d = document.createElement('div');
document.body.appendChild(d);
</script>
</td>
</tr>
</table
An example of this can be found here
The following code html/js wil not: (again in IE7 b3)
<div>
<script type="text/javascript">
var d = document.createElement('div');
document.body.appendChild(d);
</script>
</div>
An example of this can be found here
I hope there is an easy work around for this. -
yman wrote:Well it appears that the problem is triggered by certain behaviours in relation to elements being appended to the dom.
The following html/js will flag an operation aborted error: (tested in IE7 beta 3)
<table>
<tr>
<td>
<script type="text/javascript">
var d = document.createElement('div');
document.body.appendChild(d);
</script>
</td>
</tr>
</table
An example of this can be found here
The following code html/js wil not: (again in IE7 b3)
<div>
<script type="text/javascript">
var d = document.createElement('div');
document.body.appendChild(d);
</script>
</div>
An example of this can be found here
I hope there is an easy work around for this.
Interesting. Is there any particular reason to put a Script block inside a table cell?
Thanks
-Dave -
yman wrote:Well it appears that the problem is triggered by certain behaviours in relation to elements being appended to the dom.
The following html/js will flag an operation aborted error: (tested in IE7 beta 3)
<table>
<tr>
<td>
<script type="text/javascript">
var d = document.createElement('div');
document.body.appendChild(d);
</script>
</td>
</tr>
</table
An example of this can be found here
The following code html/js wil not: (again in IE7 b3)
<div>
<script type="text/javascript">
var d = document.createElement('div');
document.body.appendChild(d);
</script>
</div>
An example of this can be found here
I hope there is an easy work around for this.
Interesting. Is there any particular reason to put a Script block inside a table cell?
Thanks
-Dave -
yman wrote:Well it appears that the problem is triggered by certain behaviours in relation to elements being appended to the dom.
The following html/js will flag an operation aborted error: (tested in IE7 beta 3)
<table>
<tr>
<td>
<script type="text/javascript">
var d = document.createElement('div');
document.body.appendChild(d);
</script>
</td>
</tr>
</table
An example of this can be found here
The following code html/js wil not: (again in IE7 b3)
<div>
<script type="text/javascript">
var d = document.createElement('div');
document.body.appendChild(d);
</script>
</div>
An example of this can be found here
I hope there is an easy work around for this.
Interesting. Is there any particular reason to put a Script block inside a table cell?
Thanks
-Dave -
I dont personally put a script tag in a table but I got this example after a bit of googling.
This is going to be a (I need to watch my language) to try and debug in my app
Trying to work out where the offending code is.
I suppose it is partly my fault for developing against FF
-
DMassy, do you have any ideas on how to control this problem?
-
yman wrote:DMassy, do you have any ideas on how to control this problem?
Can you put your script blocks in the head of the page not in the middle of a TD element? -
As I mentioned 3 posts up, I dont personally do that. I used that as an example (I found the example via googling) because I couldn't post my own code, yet.
-
yman wrote:As I mentioned 3 posts up, I dont personally do that. I used that as an example (I found the example via googling) because I couldn't post my own code, yet.
Sorry. It is not clear from your post what you can control and what sort of workaround you are looking for.
The issue appears to be that you are trying to append a child to the end of the body before we have completed parsing that element. That causes things to get a little confused. One possibility is to put defer='true' on script elements so they run after the body has been parsed and the element tree built.
If you can avoid trying to append something to something that is not yet built then it shoudl solve the issue.
Thanks
-Dave -
DMassy wrote:

yman wrote:As I mentioned 3 posts up, I dont personally do that. I used that as an example (I found the example via googling) because I couldn't post my own code, yet.
Sorry. It is not clear from your post what you can control and what sort of workaround you are looking for.
The issue appears to be that you are trying to append a child to the end of the body before we have completed parsing that element. That causes things to get a little confused. One possibility is to put defer='true' on script elements so they run after the body has been parsed and the element tree built.
If you can avoid trying to append something to something that is not yet built then it shoudl solve the issue.
Thanks
-Dave
Yeah, sorry for me not being clear.
Well I added "defer='true'" but now I am getting a "permission denied" error. I have seen this behaviour before in regards to the xmlhttp object acessing certain Urls. I uncommented out the xmlhttp.send to see if that would resolve the permission error... still the same. I can't even debug the script since the debugger says that there is "no source code available".
It is late now, I will have a look at it again tomorrow.
Thanks for your help, so far
-
The way Google used to suggest you use their map API leads very easily to putting snippets of JavaScript into the markup tree. (They seem to have updated their code examples.) That's how I got to this thread.
-
yman wrote:
I suppose it is partly my fault for developing against FF
It's probably a good idea to test with multiple browsers all along the development cycle. But to say it's partly *your fault* would be to underplay the gross mishandling of the IE project on the part of Microsoft.
-
dphiffer wrote:But to say it's partly *your fault* would be to underplay the gross mishandling of the IE project on the part of Microsoft.
According to the XHTML 1.0 Transitional DTD, <script> elements are allowed only inside the <head> element.
<!ENTITY % head.misc "(script|style|meta|link|object|isindex)*">
Both FireFox and IE allow for some latitude with malformed markup and, given that's not a part of the official spec, any implementor can do whatever they want with it.
So FireFox is "grossly mishandling" this feature as much as IE is doing it. -
I have fixed the problem which I was encountering when I started this thread. I created a seperate bootstrap function which was then hooked into the body onload event (similar to an extend of using defer=true). The bootstrap function can then successfully append elements to the DOM tree.
I was trying to append elements to the DOM even when the tree wasn't fully created - it was my fault.....
-
Hi all!
But what is with the ASP.Net engine? When you register any script in the Page it will be written into the body element (inside the form).
From this view, you will never be able to make a valid page with ASP.Net.
Does anyone have suggestions for this one?
Patrick
Thread Closed
This thread is kinda stale and has been closed but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.