Translate

Archive for August, 2006

Gotcha!

Friday, August 4th, 2006



Gotcha!

Originally uploaded by Gubatron.


Finally got the damn little mouse that we had as an unwanted guest in the apartment. There were two, finally got them both today with this trap we got at the 99 cent store.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)

Internet Explorer Javascript vs Firefox: AJAX Error Recovery in Firefox

Friday, August 4th, 2006

After a good 4 hours or more, we finally found the error, it was our bad, but Firefox was helping us, Internet Explorer was keeping the standards but not reporting a warning or recovering from our fault…

We’re currently using a complex ajax call that needs to pass a bunch of variables that have been set on smarty (don’t ask why please)… to make it easy, we decided to do:

$all_smarty_variables = $smarty->get_template_vars();
$jsonString = $jsonEncode->encode($all_smarty_variables);

There’s this thing thats way better than XML to pass information about objects… its called JSON, it’s basically a way for Javascript to serialize its objects in strings, you can send and receive these strings via AJAX requests, and just eval them, or have JSON libraries on your favorite language used on the server side to unmarshall, and re-instanciate the objects that come from javascript.

So… in short words, no need for XML to send and receive objects, no more parsing crap, plus I would say the transfered data is much less. If you don’t think I’m on the right track, monitor the AJAX requests that GMail does, you’ll see some JSON action, or probably a custom implementation of google, they don’t send XML… why do that when you can send objects…

So now that I spent two paragraphs selling you JSON to do your remote procedure calls, I’ll tell you the odity.

As always everything was working fine with us doing our remote call and sending our big ass string in Firefox.

But when we tried in IE, it didnt work.

We tried adding slashes, removing slashes, htmlfying it, you name it we tried it.

After good 4 hours, we found out IE is strict about the size of URL requests done via GET (which makes sense, 1024bytes probably)…
but in any case, our (S)AJAX call worked just fine with Firefox

We went to Sajax.php and saw the following config…

$GLOBALS['sajax_request_type'] = 'GET';

So yeah, we made that a ‘POST’ request type and it worked, it was our bad.

Is this one point in favor of IE for keeping HTTP real? Is this one point in favor of Firefox developers for probably checking the request URL ‘s length before doing an AJAX GET and arbitrarily changing the method to POST?

You decide.
You’re a good geek if you are still reading this, hope you feel me.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Google Buzz (aka. Google Reader)


  • Categories

  • February 2012
  • January 2012
  • December 2011
  • November 2011
  • October 2011
  • September 2011
  • August 2011
  • June 2011
  • May 2011
  • April 2011
  • March 2011
  • February 2011
  • December 2010
  • November 2010
  • October 2010
  • September 2010
  • August 2010
  • July 2010
  • June 2010
  • May 2010
  • April 2010
  • March 2010
  • February 2010
  • January 2010
  • December 2009
  • October 2009
  • September 2009
  • July 2009
  • May 2009
  • April 2009
  • March 2009
  • February 2009
  • January 2009
  • December 2008
  • November 2008
  • October 2008
  • September 2008
  • August 2008
  • July 2008
  • June 2008
  • May 2008
  • April 2008
  • March 2008
  • February 2008
  • January 2008
  • December 2007
  • November 2007
  • October 2007
  • September 2007
  • August 2007
  • July 2007
  • June 2007
  • May 2007
  • April 2007
  • March 2007
  • February 2007
  • January 2007
  • December 2006
  • November 2006
  • October 2006
  • September 2006
  • August 2006
  • July 2006
  • June 2006
  • May 2006
  • April 2006
  • March 2006
  • February 2006
  • January 2006
  • December 2005
  • November 2005
  • October 2005
  • September 2005
  • August 2005
  • July 2005
  • June 2005
  • May 2005
  • April 2005
  • March 2005
  • February 2005
  • January 2005
  • December 2004
  • November 2004
  • October 2004