Archive for the 'JavaScript' Category

Pass multi-dimensional array in ajax request with jQuery

Wednesday, December 24th, 2008

I have a bunch of javascript objects flying around page that interacts with Google Maps, and I wanted to get the data out of some of the objects to pass via a jQery AJAX $.post call to a PHP script. jQuery seems to have everything, so I was surprised there wasn’t any functionality built in […]

Zend_Acl, jQuery and HTTP Status Codes

Wednesday, November 26th, 2008

In my controllers, I use Zend_Acl to check whether or not a user is allowed to perform an action (i.e. should the code in the method be executed). I also have to check permissions once in a method, as someone might be trying to access an object that does not belong to them - i.e. […]

Dojo Lightbox, CDN and Problems

Friday, November 14th, 2008

I have spent over an hour trying to get a simple page using Dojo’s lightbox and no luck. I am more of a jQuery fan, but thought I would give Dojo a try since it is coupled with Zend Framework now. I tried adding the script and css tags manually to the page, not through […]

Testing if Something is Undefined in Javascript

Sunday, October 14th, 2007

Had a question come up from a colleague that used to cause problems when I first started using JavaScript. How to test whether a variable is undefined:

var a = ‘defined’
if(typeof a == ‘undefined’) {
alert(’it is undefined’);
}

Tweaking other people’s JavaScript functions

Wednesday, October 10th, 2007

Javascript is an interesting language and like any language, the more you use it, the more functionality you find. Without getting into the specfics, I occasionally need to modify a site’s HTML and or JavaScript with an external JavaScript file (i.e I can’t touch the page I am modifying, I can only touch one external […]