cformsII Support Forum
Current User: Guest *Frequently Asked Questions*
Search 
Search Forums:


 




RESOLVED: JS Error in IE

Add a New Topic Reply to Post
Post

Eric - Guest

7:37 am - October 19, 2007

I have a basic install of Version v5.5 running on 2.3

 http://www.erickochphoto.com/main

 A programming friend has stop on errors enabled in IE, and found a problem on my site.

There is JS error that comes up when ever you click on a link on any page or post in the blog. We traced it to the simplecalendar.js file, and the section of code under

/* SOURCE FILE: PopupWindow.js */

 

When I delete that section the error goes away and there are no other problems that I have (other than I can not use the simplecalendar to help my clients enter the date Cry).

If there is a way to fix this it would be greatly appreciated.  

Thanks for the great plugin.

Oliver - Admin

7:43 am - October 19, 2007

posts 3656

Thanks for the heads-up, but I don't think it's a bug, since it runs fine on a standard WP install (both IE & FF) - hard to tell without the actual error message.

It seems more of an incompatibility with another plugin you're running (perhaps using a function with the same name?)

I noticed that disabling 'Popup Date Picker' on the Plugin Settings tab will not avoid including the respective javascript file (causing the issue on your WP deployment).

This will be fixed in v5.6 so the JS will not get loaded if it isn't required.

(For the time being you can completey remove that line in cforms.php/at the bottom

 

Eric - Guest

6:43 am - October 20, 2007

Here is the bug as described by my programming friend (the new update to 5.5.1 did not fix it, but it does make it easy to turn off).

 

function PopupWindow_hidePopup(){if(this.divName != null){if(this.use_gebi){document.getElementById(this.divName).style.visibility = "hidden";}else if(this.use_css){document.all[this.divName].style.visibility = "hidden";}else if(this.use_layers){document.layers[this.divName].visibility = "hidden";}}else{if(this.popupWindow && !this.popupWindow.closed){this.popupWindow.close();this.popupWindow = null;}}}

 

 

 document.getElementById(this.divName) is returning null, so the following code fails

Oliver - Admin

8:09 am - October 20, 2007

posts 3656

Thanks for following up!

I can't seem to replicate the error in my test environment, but will try harder.... ;-)

Oliver - Admin

11:15 pm - October 21, 2007

posts 3656

It seems to be specific to the above deployment of WP, as I can't reproduce the effect. cforms works fine with jQuery.

Martin - Guest

9:36 pm - October 23, 2007

I can confirm the bug on WP 2.3 German edition with no other PlugIns activated and IE 7.

The reason is that the getElementById part of

document.getElementById(this.divName).style.visibility = "hidden";

is null for pages without a form.

Btw: You have to click on a page without a form to see the error.

Regards

Martin

Oliver - Admin

9:40 pm - October 23, 2007

posts 3656

Thanks for confirming, but can you share the URL ? It would help to trouble-shoot, since it did work fine in my test environment (WP2.3 - english , IE 6&7).

Martin - Guest

9:48 pm - October 23, 2007

http://heimatverein-hitdorf.de/

Go and see for yourself. But hurry because the site is useless since it throws an error when you click on it...

(And if javascript error notification is active.)

Martin - Guest

9:53 pm - October 23, 2007

There are a lot of these constructs in simplecalendar.js (or PopWindow.js).

Please let me know when you are finished since I'd like to disable the javascript popup.

Btw: This is a cross browser bug Wink

Oliver - Admin

9:59 pm - October 23, 2007

posts 3656

Thanks, you can turn the JS popup picker support off (which should fix the problem for the time being).

I agree, it is a cross browser issue as far as your blog and Eric's is concerned, but I can't for the life of it replicate in my environment...

Anything special you're running?

 

Martin - Guest

10:37 pm - October 23, 2007

Nothing I am aware of.
I also tried to disable all other PlugIns but the effect remains the same.

To be honest I do not understand why this should not happen in your environment since it is a very obvious bug.

But I'll try to fix it and let you know.

Oliver - Admin

10:40 pm - October 23, 2007

posts 3656

RESOLVED. And I stand corrected :-)

I will issue the patched v5.52 tomorrow - too late already...thanks again for pointing it out (it's all about the div 'datepicker' not being available).

Martin - Guest

11:02 pm - October 23, 2007

That's good, then I can go form some Coke and chocolate before I go to bed.

The occurence of the error might also be related to the compliance mode the browser is running the document in. So if your theme is not XHTML like mine (and probably Erics), the script doesn't use getElementById and maybe behaves different.

Good night.

Martin

Add a New Topic Reply to Post


Reply to Topic: RESOLVED: JS Error in IE
PLEASE READ THE FAQs FIRST! THANK YOU.

NOTE: New Posts are subject to administrator approval before being displayed

Guest Name (Required):

Guest EMail (Required):

Guest URL (required)

Math Required!
What is the sum of: 10 + 1        (Required)

Topic Reply:


 
© Simple:Press Forum - Version 3.1.3 (Build 356)