{"id":534,"date":"2008-09-14T09:49:13","date_gmt":"2008-09-14T13:49:13","guid":{"rendered":"http:\/\/www.dr-chuck.com\/wordpress\/?p=534"},"modified":"2011-12-17T12:27:35","modified_gmt":"2011-12-17T16:27:35","slug":"warning-chuck-is-starting-to-like-jquery","status":"publish","type":"post","link":"https:\/\/www.dr-chuck.com\/csev-blog\/2008\/09\/warning-chuck-is-starting-to-like-jquery\/","title":{"rendered":"Warning: Chuck is Starting to Like JQuery"},"content":{"rendered":"<p>Well I have started hacking on my &#8220;next generation LMS&#8221; this weekend &#8211; I hope to have an early prototype in hand in time for a Monday meeting with the Med school folks.  I settled on a framework for the prototype &#8211; promise you won&#8217;t laugh.   JQuery, JSON, PHP, and MySql &#8211; yes &#8211; I know &#8211; so boring.  But I can get help from other developers.<br \/>\nAnd I realized with MySql and the built in PHP5\/Apache server on my Apple Laptop &#8211; I was nuts to do anything else.  I really will miss database portability &#8211; for a few minutes :).<br \/>\nSo the first part of the weekend is to do some JQuery to build the menu system (isn&#8217;t it fun to make really basic stuff at the beginning of a project?).  My first reaction to JQuery was &#8220;yuck!&#8221; &#8211; I had seen Prototype in Ruby and loved it &#8211; because it did the few things I needed.<br \/>\nWhen I first saw JQuery, it was like &#8220;Where is the simple stuff?&#8221;  JQuery was a freaking DOM Operating system and all I wanted was a few utility things.  And worse &#8211; the JQuery documentation does not give simple examples for simple things &#8211; the JQ community assumes you are a battle-scarred Javascript guru when you walk in the door.<br \/>\nWhile the JQ syntax is obtuse, it is far better than the code these gurus wrote previously.   For me &#8211; I never wrote that complex code &#8211; I am just a dummy &#8211; I don&#8217;t want to learn the nasty way for IE5 and then re-learn the easy JQ way.  I just want it easy!<br \/>\nBut with a cool mentor like Noah &#8211; I get over my mental blocks and get the simple stuff figured out &#8211; and once you get the simple stuff working &#8211; JQ is a wondrous place.  If you wonder how wide the document is, start in Google &#8211; look at this page:<br \/>\nhttp:\/\/www.howtocreate.co.uk\/tutorials\/javascript\/browserwindow<br \/>\nOh yea &#8211; who is your Javascript daddy?  You need to write case statements within case statements withing case statements.  If you are patient and keep googling, you will find this page:<br \/>\nhttp:\/\/plugins.jquery.com\/node\/1089<br \/>\nA 4K download to find the document width &#8211; Better than me writing all the case statements &#8211; since the dimensions plugin documentation was not set up for dummies like me &#8211; it showed me how to do a million amazing things but not the simple thing I wanted &#8211; so I got bored with trying to figure that out &#8211; I kept Googling&#8230;<br \/>\nAnd finally I came to this:<br \/>\nalert( $(document).width() );<br \/>\nUh &#8211; this is right there in JQuery 1.2<br \/>\nI can now make my menu dock on the left!  Yay!<br \/>\nNote to self: Don&#8217;t assume JQuery cannot do something &#8211; just keep looking &#8211; someone will have blogged a simple JQuery code solution.<br \/>\nThe more dummies like me who use JQuery &#8211; the more simple examples we will have.  Coming up &#8211; the simplest JSON \/ JSONB example you ever saw &#8211; I call it the &#8220;Missing JQuery tutorial&#8221;..<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Well I have started hacking on my &#8220;next generation LMS&#8221; this weekend &#8211; I hope to have an early prototype in hand in time for a Monday meeting with the Med school folks. I settled on a framework for the prototype &#8211; promise you won&#8217;t laugh. JQuery, JSON, PHP, and MySql &#8211; yes &#8211; I [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-534","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/posts\/534","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/comments?post=534"}],"version-history":[{"count":1,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/posts\/534\/revisions"}],"predecessor-version":[{"id":2659,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/posts\/534\/revisions\/2659"}],"wp:attachment":[{"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/media?parent=534"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/categories?post=534"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dr-chuck.com\/csev-blog\/wp-json\/wp\/v2\/tags?post=534"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}