Sure. There is a small difficulty in that this code is supposed to run an iPhone/Webkit and some API´s don´t make sense in a standard web enviroment. But basically you can just strip all that exra bits and pieces and just run it in a browser. I should actually do this myself and see if it is an issue with Webkit or a conflict with some other library... hm... I´ll post it anyway.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>test</title> <meta name="viewport" content="width=320; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/> <meta name="apple-touch-fullscreen" content="yes" /> <meta name="apple-mobile-web-app-capable" content="yes" /> <style type="text/css" media="screen">@import "css/jqtouch.css";</ style> <link rel="apple-touch-icon" href="jqtouch.png" /> <script src="js/phonegap.js" type="text/javascript" charset="utf-8"></script> <script src="js/jquery.js" type="text/javascript" charset="utf-8"></script> <script src="js/jqtouch.navigate.js" type="text/javascript" charset="utf-8"></script> <script src="js/jqtouch.animate.js" type="text/javascript" charset="utf-8"></script> <script type="text/javascript" charset="utf-8"> $(function(){ // $.fn.itouch.preloadImages(['iui/toolbar.png', 'iui/ selection.png']); $('#backButton').goback(); $('ul li a').drilldown(); }) var getLocation = function() { var suc = function(p){ //alert(p.latitude + " " + p.longitude); //$('#home ul').append('<li>pleeeeease show up</li>'); //$('#home>ul').append('<li>or that one</li>'); //var test = $("<li>maybe that one</li>").appendTo($("#home")); $('ul#home').html('<li>last chance</li>'); alert($('ul#home').html()); }; var fail = function(){}; navigator.geolocation.getCurrentPosition(suc,fail); } var preventBehavior = function(e) { e.preventDefault(); }; function init(){ getLocation(); } </script> </head> <body onload="init();"> <div class="toolbar"> <h1 id="pageTitle">gTracks</h1> <a id="backButton" class="button" href="#"></a> <a class="button flip" href="#settings">Settings</a> </div> <ul id="home" title="gTracks" selected="true"> <li><a href="#tracker">Tracker</a></li> </ul> <ul id="tracker" title="Tracking Data"> <li id="trackFirst"></li> </ul> </body> </html> Thanks a lot, Elmar On Mar 11, 12:32 am, mkmanning <michaell...@gmail.com> wrote: > @Elmar, there's nothing wrong with your jQuery; there is with > Joseph's: creating a closingLIwon't work :( > > Could you show where in your script you're trying to append theLI? > > On Mar 10, 4:03 pm, Joseph Le Brech <jlebr...@hotmail.com> wrote: > > > $("</li>").appendTo("#myList").html("Please show up"); > > > the one you used those should also work tho. > > > > Date: Tue, 10 Mar 2009 14:18:57 -0700 > > > Subject: [jQuery]add<li> to <ul> > > > From: elsch...@googlemail.com > > > To: jquery-en@googlegroups.com > > > > Hi there, > > > I am probably trying the most basic example and failed in my attemps > > > so far. I would like toaddnew <li>´s to an existing <ul> with > > > jQuery. What I am trying to do: > > > > in my script: > > > ... > > > $('#myList').append('<li>pleeeeease show up</li>'); > > > ... > > > > in my HTML: > > > ... > > > <ulid="myList" title="someTitle" selected="true"> > > > <li><a href="#internalLink">existing link</a></li> > > > </ul> > > > ... > > > > But although I ask really nicely, the newliwill never show up. The > > > "home"ulis found correctly by jQuery and I can output it´s contents. > > > > What am I doing wrong? > > > Thanks a lot! > > > _________________________________________________________________ > > Twice the fun—Share photos while you chat with Windows Live Messenger. > > Learn > > more.http://www.microsoft.com/uk/windows/windowslive/products/messenger.aspx