jQuery’s datepicker driving me nuts October 28, 2008 10:01 am
Posted by Doug McCaughan in : JavaScript, Technology, jQuery , add a commentI love jQuery! And its UI library. But I’m having difficult implementing a simple date picker. The datepicker method is throwing an error for me: "inst is undefined datepicker" The solution of adding "{onSelect: function() {}}" did not work. I’m at the point of no return. Choosing a different calendar application.
Update: Solved! I had an artifact left over from trying to implement the Yahoo! User Interface (YUI) Library’s calendar. jQuery’s UI datepicker conflict’s with YUI’s datepicker.
add a commentCode Buzz October 20, 2008 10:36 am
Posted by Doug McCaughan in : AJAX, Daily Life, JavaScript, PHP, Programming, Technology , add a commentRunners get a runner’s high. I’ve got a coder’s high. My head is buzzing as I’ve been hitting the keys hard. My current PHP application has dynamic content loaded via AJAX but when the user navigates with the browser’s forward or back buttons the state is lost, that is, all the dynamic content disappears. Also if the natural navigation of the application takes the user away from the dynamically generated content, when they return the content is lost and the user frustratingly has to drill down, dynamically loading more content, to get back to where they were. Using jQuery, some custom JavaScript, and some fandangled PHP, I have overcome this obstacle and created a state engine that remembers which content was loaded and re-presents it on the screen whenever the user navigates with the browser’s forward or back buttons or the applications natural navigation. I’ve just finished the behind the scenes mechanics of this code and now have to fix the presentation level (after a 10 minute break). Whew! This was fun!
add a commentjQuery Support on IRC is on Freenode August 29, 2008 3:55 pm
Posted by Doug McCaughan in : Communications, JavaScript, Programming, Technology , add a commentFor those looking, jQuery JavaScript Library support on IRC is on the Freenode servers at #jquery.
Update: Also on Freenode, #jquery-ui regarding jQuery UI.
add a commentJS Prototype Support on IRC is on Freenode August 29, 2008 3:52 pm
Posted by Doug McCaughan in : JavaScript, Programming, Technology , add a commentFor those looking, Prototype JavaScript Framework support on IRC is on the Freenode servers at #prototype.
add a commentToday’s Technical Challenge November 26, 2007 4:58 pm
Posted by Doug McCaughan in : JavaScript, Programming, Technology , 1 comment so farThis one sounds pretty simple. I bet you can’t do it! (That is coming from the guy who claims anything can be done…I will find a way!).
The challenge: Part 1- Write a piece of JavaScript that pops an alert box with the message "You left!" when focus is lost on the browser. This means that if someone is looking at the webpage in Firefox and then switches to another webpage in a different tab, different window, or goes to a different application altogether (say Microsoft Word or Internet Explorer), then the alert box should appear. Any loss of focus to the active webpage makes the alert popup.
The challenge: Part 2- Write a piece of JavaScript that pops an alert box with the message "You returned!" when focus is returned to the browser. This means if someone was checking their email, using Internet Explorer, or was in a different Firefox tab, when they return to your webpage the alert box pops up.
The JavaScript for this challenge should work in both Firefox and Internet Explorer. The user should be able to repeatedly remove focus and return to focus and see both messages multiple times.
Good luck!
References
- Mozilla.org reference to window.onblur Using their code example works differently in Firefox and Internet Explorer. In Firefox, the event fires twice meaning when I move away from the window, I get two alert boxes. In Internet Explorer the event fires once. Returning focus to the window and leaving against does not cause a blur event. So this appears to work once per loading of the window and not through repeated lost focus and refocuses.
- Incorrect behavior of window.onblur event under IE and a workaround I need to test this in IE7




