IE problem - Something's wrong with this JS

Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Reply

Join Date: Dec 2006
Posts: 9
Reputation: XtremeCamera is an unknown quantity at this point 
Solved Threads: 0
XtremeCamera XtremeCamera is offline Offline
Newbie Poster

IE problem - Something's wrong with this JS

 
0
  #1
Jan 15th, 2007
Good morning,

I paid many thousands of dollars to a company that created my photo community (xtremecamera.com). Problem is, the site does not work in IE, I get the "Operation Aborted".

With the help of a great poster in the PHP section of this forum it has been determined that a single javascript is the problem. On my index.php page there are several calls for javascripts, if I remove the call for xc_modules.js the site loads fine in IE (but that script keeps hundreds of items in check, it is vital to the site)...So, there is something wrong with the script. All the other, well tested, scripts work fine.

Would anyone on this forum please take a minute or two, download my script (attached) and see if something jumps out at you? I am not asking that anyone spend any amount of real time on it, just a glance, maybe find a reason why IE doesn't like this script...

I would be very much appreciative if you can. Many thanks!

John
xtremecamera
Attached Files
File Type: zip xc_modules.js.zip (10.4 KB, 2 views)
Reply With Quote Quick reply to this message  
Join Date: Jul 2006
Posts: 1,091
Reputation: MattEvans is a jewel in the rough MattEvans is a jewel in the rough MattEvans is a jewel in the rough 
Solved Threads: 63
Moderator
Featured Poster
MattEvans's Avatar
MattEvans MattEvans is offline Offline
Veteran Poster

Re: IE problem - Something's wrong with this JS

 
0
  #2
Jan 15th, 2007
Make sure that you don't call functions to modify the DOM for elements that have not yet been finished. That is, minimize the use of inline calls to JavaScript functions that attempt to modify the document.

You should put all calls to functions that use code like document.createElement(); or [object].appendChild(); in the body onload event; otherwise the body doesn't exist yet.

The 'Operation Aborted' error in IE is in relation to that; do a Google search for javascript "Operation Aborted".

I imagine the problem is less about the code in that module than about the way you are using that code, I had a brief look, I see some cases where document.createElement is used. How are you calling the functions in that module from your PHP page?
Plato forgot the nullahedron..
Reply With Quote Quick reply to this message  
Join Date: Dec 2006
Posts: 9
Reputation: XtremeCamera is an unknown quantity at this point 
Solved Threads: 0
XtremeCamera XtremeCamera is offline Offline
Newbie Poster

Re: IE problem - Something's wrong with this JS

 
0
  #3
Jan 15th, 2007
Matt,

Just about everything you said went straight over my head (I think I have headache now):eek:

I've attached the following files to this post in case you have a second to take a look; the index.php file (the entire site is put together with this file), gallery.php file (so you can see a typical page), and sidebar_main.php (so you can see the other part of the page.

The site is modular, in that the index page will take the header, the drop down control panel, the sidebar, and the main content page and put them together.

Again, a huge thank you for responding. I think a lot of people don't realize that people like you cruise the site and out of the desire to help people will go through these posts looking for people like myself that need help. Its something you don't see much in the real world, so believe me I am very thankful for any assistance you can lend.

John
xtremecamera
Attached Files
File Type: zip xcsite.zip (28.6 KB, 6 views)
Reply With Quote Quick reply to this message  
Join Date: Jul 2006
Posts: 1,091
Reputation: MattEvans is a jewel in the rough MattEvans is a jewel in the rough MattEvans is a jewel in the rough 
Solved Threads: 63
Moderator
Featured Poster
MattEvans's Avatar
MattEvans MattEvans is offline Offline
Veteran Poster

Re: IE problem - Something's wrong with this JS

 
0
  #4
Jan 15th, 2007
I can't test the PHP on a server/lhost at the moment, so this is based on source code analysis only, and given that the problem 'Operation Aborted' occurs as a result of the modification of incomplete elements.

----------------

On line 59 of xc_modules.js, is this statement:
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. this.CSSattach();

Try commenting it out/removing it temporarily.

That appears to be the only line that modifies the DOM while loading is incomplete (SI.onbeforeload is called from an inline script at the very end of topnav.php)

It also seems like when you include includes/gallery.php into index.php that you load a page with a 'double' <html><body> element.... You can see that for real by viewing the source from the page index.php?section=gallery at your domain.

You could fix that problem by removing this from the top:
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
  5. </head>

and this from the bottom:
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. </body>
  2. </html>

of includes/gallery.php

whether that will cause stranger behaviour, I can't say without testing.

------------------------

I've gotta say, you paid too much to the wrong people for that implementation.. it's not very well done.

I will try and run a test of the files you attached tonight if I get some time...
Plato forgot the nullahedron..
Reply With Quote Quick reply to this message  
Join Date: Dec 2006
Posts: 9
Reputation: XtremeCamera is an unknown quantity at this point 
Solved Threads: 0
XtremeCamera XtremeCamera is offline Offline
Newbie Poster

Re: IE problem - Something's wrong with this JS

 
0
  #5
Jan 15th, 2007
Matt,

I cannot thank you enough! Taking that one line out seems to have done the trick... without causing any problems that I can see...

I know I overpaid, sadly enough. I am now looking to hire someone to clean the code and the database up.... Interested?

John
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum
Thread Tools Search this Thread



Tag cloud for JavaScript / DHTML / AJAX
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC