Use document.all instead... but I believe that iMarc did so, correct?
something to the effect of:
Code:var obj = document.all?document.all:document.getElementsByTagName("*")
Use document.all instead... but I believe that iMarc did so, correct?
something to the effect of:
Code:var obj = document.all?document.all:document.getElementsByTagName("*")
- Mike
Thats why there is a "Close Calendar" button. Thats not easy to see? I thought about making an "X" button but I didn't want to use images, I wanted the calendar to be plug and play.
I don't know what you mean by this. I don't know what, "the old way" means
Would the following code work?
Yes I got it from Dustin Diaz. I only used the function once to walk the dom and attach the calendar to the appropriate input fields.Code:getElementsByClass(popUpCal.inputClass, document, input);
I tested it in everything I had available to me. IE6, IE7, FF1, FF2, Opera, Netscape, AOL Browser. Oh and by the way... Thank you for taking such a close look at the code!
Last edited by iMarc; 02-09-2007 at 05:50 AM. Reason: I wanted to say thank you to blm126
Oh, now I see it. Maybe it needs be moved or made bigger, because if I missed it, then others probably will,too.
I don't know what, "the old way" means
The add event function you are using does not cover that. You might be better off just writing the load code yourself.Code:window.onload = popUpCal.init;
Yes, that looks right. There is nothing wrong with other way, but this should be faster, and have better compatibility.Would the following code work?
Code:getElementsByClass(popUpCal.inputClass, document, input);
That looks pretty good. The comments above should increase the chances of it working in untested browsers, like Safari or Konqueror.I tested it in everything I had available to me. IE6, IE7, FF1, FF2, Opera, Netscape, AOL Browser.
PS:Your demo link doesn't seem to work anymore. I had to navigate through your site to find it.
Although not perfect, the following method of creating an onload event for just about any script that will 'play nice with others' is pretty darn good:
Just substitute your init for myInitFunction. The only thing that you may need to add is an e in myInitFunction(e); if your function requires it. The only real drawback to this method is that if either of the older methods must be used and there is a later onload event on the page, there will be a problem.Code:if ( typeof window.addEventListener != "undefined" ) window.addEventListener( "load", myInitFunction, false ); else if ( typeof window.attachEvent != "undefined" ) window.attachEvent( "onload", myInitFunction ); else { if ( window.onload != null ) { var oldOnload = window.onload; window.onload = function ( e ) { oldOnload( e ); myInitFunction(); }; } else window.onload = myInitFunction; }
Last edited by jscheuer1; 02-10-2007 at 05:56 AM. Reason: dyslexia
- John________________________
Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate
I just released my blog today and there is a redirect issue. The link works now. I'll make the few changes to the code in a bit and make a downloadable zip file with all of my code and styles stripped to ready it for publishing. I'll let you know when that happens. Thanks again for the great comments!
I just got a chance to check, it works fine in Konqueror.
Updated have been made!
- The Clean Calendar code is up for download.
- Parameters added to getElementsByClass function:
Code:var x = getElementsByClass(popUpCal.inputClass, document, 'input');- Updated code to use jscheuer1's on load event:
Code:if ( typeof window.addEventListener != "undefined" ) window.addEventListener( "load", popUpCal.init, false ); else if ( typeof window.attachEvent != "undefined" ) window.attachEvent( "onload", popUpCal.init ); else { if ( window.onload != null ) { var oldOnload = window.onload; window.onload = function ( e ) { oldOnload( e ); popUpCal.init(); }; } else window.onload = popUpCal.init; }
ddAdmin! Where are you?
Bookmarks