I'm playing around with jQTouch for an iPhone OS app that I've been
toying with off and on for a while. I wanted to try my hand building
it as a web app so I started playing with jQTouch. For reference, here
is the page+source (all my code is currently in index.html so you can
just "View Source" to see it all):

http://rpj.me/doughapp.com/wd/

Essentially, I'm trying to save pertinent JSON objects retrieved from
Google Local into DOM objects using the data() method (in this
example, obj is the Google Local object):

--- code ---
$('#locPane').data('selected', obj);
--- /code ---

then later (in a different "pane"), retrieving that object to be used:

--- code ---
$('#locPane').bind('pageAnimationEnd', function(e, inf) {
            var selobj = $(this).data('selected');
            // use 'selobj' here ...
}
--- /code ---

In Chromium and Safari on the desktop OS (Snow Leopard in my case),
this works perfectly (try it out).

However, the same code returns undefined for the call to $(this).data
('selected') in the second snippet above. I've also tried $('#' +
e.target.id).data('selected') and even the naive $('#locPane').data
('selected'). All variants return undefined in the iPhone OS version
of WebKit, but not on the desktop.

Interestingly, the running this on Mobile Safari in the iPhone
Simulator fails as well.

If you look at the full source, you'll see that I even try to save
this object into my global jQTouch object (named jqt in my code).
This, too, fails on the mobile platform.

Has anyone else ever ran into this? I'll admit to not being a web/
javascript programmer by trade, so if I'm making an idiot's error
please call me out on it.

Thank you in advance for the help! -RPJ

(this is a cross-post from a stack overflow posting: http://rpj.me/-N
. Apologies if this is inappropriate, but I didn't learn of this list
until after posting to stack overflow.)

Reply via email to