javascript - wordpress mobile applications with phonegap -
i'm reading tutorial , i'm having problems examples... tried run examples in localhost i'm encountering errors , don't know be. should getting first post of wp, instead of i'm getting error uncaught referenceerror: url not defined. sugestions??? thanks!
<!doctype html> <html> <header> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> <script> (url,target_div) { var url = url jquery.ajax({ url: url, datatype: 'json', success: function(data) { jquery(target_div).html(data.post.content); } }); } jquery(document).ready(function() { jquery("#title").html("<h1>hello world</h1>"); varurl = "http://localhost/phonegap/?json=get_post&dev=1&p=1"; vartarget_div = "#contents"; readsinglepost(url, target_div); }); </script> </header> <body> <div id="main"> <div id="title"></div> </div> </body> </html>
it looks "varurl =" should have space "var url =" , same "vartarget_div =" should "var target_div =" instead.
Comments
Post a Comment