Archive for the 'JavaScript' Category

MooTools, form send function and b.lastIndexOf is not a function error

Thursday, October 15th, 2009

I am new to MooTools and was using MooTools 1.2.3 to submit a form via Ajax - pretty standard stuff. When trying to put in callbacks for onSuccess,onRequest, etc… I kept getting JavaScript errors (b.lastIndexOf is not a function). Looks like you need to use set() function first, then call send(). MooTools must have […]

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’);
}