views:

489

answers:

2

I am trying to use Aptana to build an IPhone web application. I've never use Aptana. I downloaded the iphone support and started a new project. It is now asking me if I want to import a javascript library and lists the "big ones." Will IPhone's Safari be able to use these, specifically jquery? I saw that jquery had a special iphone library so my guess is no.

Should I tell it to use jquery (or other library) or should I download the special iphone javascript subset manually and try an integrate it in my project?

+3  A: 

As far as I know JQuery should work fine on the iPhone. The specific libraries you are talking about must be additions to take advantage of iPhone only features like being able to handle the display orientation event or maybe use the webkit css animation extensions.

Although you will need to be careful with events since most mouse related events on the iPhone behave a little different from what you might expect. This presentation by PPK offers some clues about it:

http://yuiblog.com/blog/2009/04/27/video-ppk-jsevents/

Javier
Great answer - My jQuery heavy sites all run fine on the iPhone, and like you say, a few problems are related to mouse events and the others relate to window resize listeners (the mobile safari browser deliberately does not fire window resize events for switching orientations). This can be a problem if you're trying to pin an element to a side of the viewable area.
guns
What can you bind to in mobile safari to detect the window resize.
Boushley
A: 

Yep, iphone should run jquery just fine. The javascript support is surprisingly capable. Although you may want to look at some of the iPhone specific libraries out there. I forget their names. iUI I think?

Squeegy