473,395 Members | 1,701 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

error in IE with CDATA inside javascript script

I am trying to debug a client's Javascript inside a php page. It runs fine
in Firefox but throws an error is IE, "can not open site,... operation
aborted."

The code starts like this:

HTML Code:
<script type="text/javascript">
//<![CDATA[

....then there's a lot of script that works fine in here

//]]>
</script>I have used the php exit;function to diagnose the error. I think,
is at the ending of the javascript because if I:

HTML Code:
//]]>
<? exit ?>
</script>it runs ok. Without the <? exit ?>, it fails.

Any ideas? I've spent a lot of time on this and would really appreciate your
help!
Jun 27 '08 #1
4 1955
TriAdmin schreef:
HTML Code:
//]]>
<? exit ?>
</script>it runs ok. Without the <? exit ?>, it fails.

Any ideas? I've spent a lot of time on this and would really appreciate your
help!
And what happens after the exit?
JW
Jun 27 '08 #2
"Janwillem Borleffs" <jw@jwscripts.comwrote in message
news:48***********************@dr4.euro.net...
TriAdmin schreef:
>HTML Code:
//]]>
<? exit ?>
</script>it runs ok. Without the <? exit ?>, it fails.

Any ideas? I've spent a lot of time on this and would really appreciate
your help!

And what happens after the exit?
JW
JW - with the exit, the page displays but the ajavscript doe snot completely
work, in IE only. In Firefox, it works as is.

The javascript is at the bottom of the page but before the footer. I am used
to javascript being in the header. As I said, I inherited this app.

This page works as is in both IE and firefox in several other parts of the
site but I am having trouble diagnoing where in the javascript it is causing
the error. Any hints on debugging javascript in Firefox? Any extensions?

Many thanks for any ideas to help this client out!!
Jun 27 '08 #3
TriAdmin wrote:
The javascript is at the bottom of the page but before the footer. I am used
to javascript being in the header. As I said, I inherited this app.

This page works as is in both IE and firefox in several other parts of the
site but I am having trouble diagnoing where in the javascript it is causing
the error. Any hints on debugging javascript in Firefox? Any extensions?
The "internet operation aborted" error in my experience usually comes
from code that's trying to add elements to the DOM (using for example
insertBefore or appendChild) before the page is finished loading
(document.readyState=="complete"). Internet Explorer is the only browser
that can't handle adding to the DOM in this way. You can sometimes get
away with adding stuff to the DOM when the document.readyState has
reached as far as the "interactive" state, but even that has some risk.
If I'm right, and your JavaScript is adding to the DOM during parsing,
you could alert the value of the readyState at the point at which you
were just about to add stuff to the DOM using
alert(document.readyState). I bet you'll find it's in one of the other
states. I don't recall all the states but I think two of them are
"initializing" and "loading". Either of these would be a bad time to be
adding to the DOM except with inline tags and/or document.write.
Jun 27 '08 #4
"Stevo" <no@mail.invalidwrote in message
news:fu*************@news.t-online.com...
TriAdmin wrote:
>The javascript is at the bottom of the page but before the footer. I am
used to javascript being in the header. As I said, I inherited this app.

This page works as is in both IE and firefox in several other parts of
the site but I am having trouble diagnoing where in the javascript it is
causing the error. Any hints on debugging javascript in Firefox? Any
extensions?

The "internet operation aborted" error in my experience usually comes from
code that's trying to add elements to the DOM (using for example
insertBefore or appendChild) before the page is finished loading
(document.readyState=="complete"). Internet Explorer is the only browser
that can't handle adding to the DOM in this way. You can sometimes get
away with adding stuff to the DOM when the document.readyState has reached
as far as the "interactive" state, but even that has some risk. If I'm
right, and your JavaScript is adding to the DOM during parsing, you could
alert the value of the readyState at the point at which you were just
about to add stuff to the DOM using alert(document.readyState). I bet
you'll find it's in one of the other states. I don't recall all the states
but I think two of them are "initializing" and "loading". Either of these
would be a bad time to be adding to the DOM except with inline tags and/or
document.write.
many thanks, I will try that now
Jun 27 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Tjerk Wolterink | last post by:
Hello all, I've a problem: i've an xsl file that has a template that contains the following: <script type="text/javascript"> <!]>> </script>
2
by: Ralf Schneider | last post by:
Hi there, can anybody help me? It won't work! Why? My declaration: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html...
6
by: Cade Perkins | last post by:
How can the CDATA ending delimiter "]]>" be represented within a CDATA section itself? Consider an XML document that is intended to contain an embedded, uninterpreted XML example. Generally,...
10
by: Dana B | last post by:
I am trying to get the values in FIELD2 and FIELD3 in the XML file below using XSLT. I can get the value of CLOB_DATA. It comes back as an string. How can I extract the values FIELD2 and FIELD3?...
12
by: Peter Michaux | last post by:
Hi, I am experimenting with some of the Ruby on Rails JavaScript generators and see something I haven't before. Maybe it is worthwhile? In the page below the script is enclosed in //<!]> ...
3
by: bobbya | last post by:
I am a newbie to javascript, I am trying to convert the numbers from 1 to 256 to there character code using the following code while executing IE7. I am getting a error on the CDATA tag. <script...
9
by: shapper | last post by:
Hello, Why do some pages I have seen have //<![CDATA[ in the beginning of a script tag before the script itself? Do I need this? Thanks, Miguel
6
by: test9991014 | last post by:
While visiting the apple.com page, I noticed an unusual form behavior that seems pretty nice, but looking at the source (below) it is unclear how it works. Is there a tutorial that explains it?...
2
by: tridirk | last post by:
Hi; I am getting a Objceted Expected Error on my forum site. I can't find what is wrong? Line: Char: Error: Object expected Code:0 the site is My SMF Forum
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.