Very Frankly Speaking

better than your blog.

Archive for June, 2008

What I like about Javascript frameworks

The thing I like about Javascript frameworks so far is that I don’t seem to be having the same kind of browser compatibility issues I used to have when I used to write most of my Javascript from scratch.  All of the browser incompatibilities have been abstracted to me so I don’t have to worry about whether or not things work in IE6, IE7, Firefox..etc FOR THE MOST PART.

No comments

Firefox 3.0 and the Web Developer Toolbar

Two new quirks with Firefox 3.0 and my Web Developer Toolbar:

1.)  I can’t do CTRL+SHIFT+S to not show the styles on my page.  Instead my bookmarks show up on a sidebar.  Boo.

2.)  I can’t do CTRL+SHIFT+Y to inspect a particular element in the DOM and see where it sits in the DOM.  Instead, this “Jump to Tag” window pops up.
I will now search for a solution.  If anyone finds it before me, please comment.

No comments

Oracle vs. MySQL (my experience)

I didn’t know you had to say “commit;” after any SQL statement in Oracle to have the changes take effect. Maybe I’m stupid but no one ever taught me this, lol.

No comments

Handling jQuery serialize() on the backend with PHP

My goal for this one situation is to validate all my form data with my backend PHP code through AJAX. If all the checks on my form don’t go through successfully, the page will not go to the next page specified in the HTML form’s “action” attribute.

On the Javascript side I use the serialize() function to take all my form data and pass it through to action.php.

$("#submit-form").submit( function(){ var data = $(this).serialize(); $.post( "action.php", { action: "ajax_verify_form", data: data }, function(response){ alert(response); return false; } ); return false; } );

On the PHP side:

if($action == "ajax_verify_form"){ $fields = explode("&",$data); foreach($fields as $field){ $field_key_value = explode("=",$field); $key = urldecode($field_key_value[0]); $value = urldecode($field_key_value[1]); eval("$$key = "$value";"); } }

Now I have all the same variables from the client side on the PHP side. Now you can do whatever form-checking you need with PHP.  If you have an error, echo the error so the callback function on the jquery.post() function will catch it.

5 comments

If I wanted to take the bus home from work…

Google Transit is saying that it will take me 53 minutes to get home if I ride the bus. It will cost me $1.50 to take the bus. It’s less than 10 miles between home and work. My car gets about 34 miles per gallon. Gas was like $3.79. I think it will be cheaper to drive.

Here’s the Google Transit route: http://twurl.nl/genltl

No comments