{"id":6905,"date":"2014-05-11T08:18:17","date_gmt":"2014-05-11T08:18:17","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/05\/11\/phonegapjsrenderrelated-issues-collection-of-common-programming-errors\/"},"modified":"2014-05-11T08:18:17","modified_gmt":"2014-05-11T08:18:17","slug":"phonegapjsrenderrelated-issues-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/05\/11\/phonegapjsrenderrelated-issues-collection-of-common-programming-errors\/","title":{"rendered":"phonegap,jsrenderRelated issues-Collection of common programming errors"},"content":{"rendered":"<ul>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/7JhAX.jpg?s=32&amp;g=1\" \/><br \/>\nGajotres<br \/>\njquery phonegap jquery-mobile<br \/>\nI am using $.mobile.changePage to transit on a new page upon clicking on listview element.This is how I am using it,$(&#8216;ul&#8217;).children(&#8216;li&#8217;).on(&#8216;click&#8217;, function () {created_date = $.trim($(this).text());$.mobile.changePage( &#8220;Image.html&#8221;, {transition: &#8216;slide&#8217;,reverse: &#8216;true&#8217;}); });This is the html page&lt;div data-role=&#8221;page&#8221; id=&#8221;SavedImage&#8221; &gt;&lt;div data-role=&#8221;header&#8221;&gt;&lt;h1&gt;&lt;\/h1&gt;&lt;a href=&#8221;#&#8221;&gt;&lt;\/a&gt;&lt;\/div&gt;&lt;div data-role=&#8221;content&#8221;&gt;&lt;img src=<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/c04a052a7b4302c95c167f062014bceb?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nlandei<br \/>\nosx phonegap path cordova<br \/>\nI have a problem while creating a new android project for phonegap 2.5.0. I use a Mac and set the path variables correctly. But after the command.\/create \/pathtoProject\/PhoneGap FirstPackage CatchMyPainPGthe terminal works for about a second and then i get the following error:An unexpected error occurred: &#8220;$ANDROID_BIN&#8221; create project &#8211;target $TARGET &#8211;path &#8220;$PROJECT_PATH&#8221; &#8211;package $PACKAGE &#8211;activity $ACTIVITY &gt;&amp;\/dev\/null exited with 1 Deleting project&#8230;What does this mean? I think i&#8217;<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/f2b58f66a540fba245e3a9484c4035e0?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nJoey<br \/>\nandroid osx phonegap<br \/>\nI installed the all the recommended programs from PhoneGap&#8217;s Getting Started Guide and followed the various steps. I created the .bash_profile file and it looks like this:export PATH=${PATH}:\/Development\/android-sdk-mac\/sdk\/platform-tools:\/Development\/android-sdk-mac\/sdk\/toolsThe Development folder is located on my desktop. Upon navigating in terminal to my bin directory and creating a new PhoneGap project, i did like so:.\/create \/Users\/joey\/PhoneGapExample nl.symvoli.phonegapExample PhoneGapDem<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/0805203af689c5e10d8c8bcf8d9cfe24?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nuser1530249<br \/>\nandroid phonegap cordova<br \/>\nWhere can I find the cordova.2.0.3.jar ? I am trying to get running with PhoneGap on android.localhost:bin shuttle$ .\/create ~\/Documents\/cordova-android\/HelloWorld com.Name.HelloWorld HelloWorld cp: \/Users\/shuttle\/Documents\/cordova-android\/framework\/cordova-2.3.0.jar: No such file or directory An unexpected error occurred: cp &#8220;$BUILD_PATH&#8221;\/framework\/cordova-$VERSION.jar &#8220;$PROJECT_PATH&#8221;\/libs\/cordova-$VERSION.jar exited with 1 Deleting project&#8230;<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/767ye.jpg?s=32&amp;g=1\" \/><br \/>\nInvincible<br \/>\njquery ajax phonegap jquery-mobile<br \/>\nI am developing an Mobile application based on the jQuery Mobile and Phonegap Framework. I am using jQuery Mobile&#8217;s Ajax Based Navigation in my application. I mean all the pages in single page template using data-role=&#8221;page&#8221;. However I am stuck with one problem.I am using the jQuery mobile&#8217;s $.mobile.changePage(&#8216;#xyz&#8217;); method to navigate between pages.but the problem is when I tap on the button the page go to other page and again comes back on the page from where I had tapped on the button or l<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/cdc12ff3c5666c8ea0a71ce872555089?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nchris<br \/>\nandroid phonegap android-2.2-froyo<br \/>\nI downloaded Eclipse Classic, Android SDK, and created a NexusOne AVD. When I run my Hello World PhoneGap app, I find the application and when it loads, it has the following error:An unexpected error occurred. Please try again later. Force close.This is my first app, so what&#8217;s the issue?<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/hSnT0.jpg?s=32&amp;g=1\" \/><br \/>\nRam kiran<br \/>\nandroid phonegap cordova<br \/>\nI&#8217;ve the following error trying to create the project in PhoneGap 2.5.0 for Android:An unexpected error occurred: &#8220;$ANDROID_BIN&#8221; create project &#8211;target $TARGET &#8211;path &#8220;$PROJECT_PATH&#8221; &#8211;package $PACKAGE &#8211;activity $ACTIVITY &gt;&amp;\/dev\/null exited with 1I&#8217;ve no idea of how to fix it. This PhoneGap tutorialThank you!<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/7018533c048bd4f86a8255bcfbdc56ff?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nTZHX<br \/>\nandroid phonegap android-4.0 cordova<br \/>\nHello i am developing an Android app based on phonegap, i am using cordova 2.0, when i try to load the index file from sd card it shows A Netwrok Error Occurred and does not load the file, but this only happens with ICS but it&#8217;s working on 3.0 and lower when i load the file from assets it works fine but the problem is when i load it from sd card here is my code `public class ApplicationView extends DroidGap {WebView appWebView;@Override public void onCreate(Bundle savedInstanceState) {\/\/ TODO Au<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/0232058838cd708f33e195b4ef346d7a?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nSjaak Rusma<br \/>\nandroid phonegap<br \/>\nI am trying to deploy phonegap for android and iOS. iOS works fine but while creating the android project like this in terminal:.\/create ~\/Documents\/testapp_android org.apache.cordova.HelloWorld HelloWorldI am getting these errors:cp: \/Users\/Pim\/Documents\/cordova-2.3.0\/cordova-android\/framework\/cordova-2.3.0.jar: No such file or directory An unexpected error occurred: cp &#8220;$BUILD_PATH&#8221;\/framework\/cordova-$VERSION.jar &#8220;$PROJECT_PATH&#8221;\/libs\/cordova-$VERSION.jar exited with 1 Deleting project&#8230;I got<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/c009ca29b5dc9c5248b5832e6cb21e46?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\npicstand<br \/>\nandroid phonegap ubuntu cordova<br \/>\nOn Ubuntu 12.10, I am trying to set up cordova 2.3.0(PhoneGap) based on the instructions present here http:\/\/docs.phonegap.com\/en\/2.3.0\/guide_getting-started_android_index.md.html#Getting%20Started%20with%20Android.but when I run the script I get the following error:An unexpected error occurred: [ ! -e &#8220;$BUILD_PATH&#8221;\/framework\/libs\/commons-codec-1.7.jar ] exited with 1 Deleting project&#8230;I looked up the commons-codec-1.7.jar and it is present where it should be:-rw-r&#8211;r&#8211; 1 user user 259600 Jan<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/5fdc8cb3f9fffec1a5d9b8e632793e04?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nIna<br \/>\njavascript jsrender<br \/>\nI would like to use a variable from my jsrender template in order to produce a snippet of javascript, but I can&#8217;t figure out how to place a &lt;script type=&#8221;text\/javascript&#8221;&gt; within my &lt;script id=&#8221;data-item-tpl&#8221; type=&#8221;text\/x-jsrender&#8221;&gt;Hopefully the below is fairly clear. The below code produces an Uncaught SyntaxError. If I remove the tags from the embedded script, then it is simply printed onto the page as text.In the code below, I am trying to generate a div with the id &#8216;chartId&#8217;, an<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/def14e2d64e6a27d81e77af8b643ba72?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nMediator<br \/>\njavascript jsrender<br \/>\nI have {{if name &amp;&amp; secondName}} {{=name}}\/{{=secondName}} {{\/if}}but this not worked. I catch error Uncaught SyntaxError: Unexpected token &amp;&amp;That I do wrong?<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/9cbdd6bbc87d39c05710989508d6763a?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nA.M.K<br \/>\njquery templates jsrender<br \/>\nI am trying to put together a template with jsRender instead of my own version that I was on, but, I keep getting this: &#8220;Uncaught JsRender Error: Syntax error Unmatched or missing tag: &#8220;{{\/for}}&#8221; in template:&#8221; followed by my entire template.Here is a truncated version of my code, any ideas as to what is going on? Or is it just the nested for loops?&lt;div class=&#8221;page&#8221; id=&#8221;{{:info.id+info.name}}&#8221;&gt;{{for sources}}&lt;header class=&#8221;feed-title&#8221;&gt;&lt;div class=&#8221;feed-title-content&#8221;&gt;&lt;span cla<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/085c7773949fd2eafb66260976725dfa?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nThe Flower Guy<br \/>\njavascript jquery jsrender<br \/>\nI have a couple of jsRender templates that are used on all pages. Instead of using the script tag method, I would prefer to precompile them and put resulting functions in an external js file.I saw a previous question that asked this but the method described doesn&#8217;t seem to work anymore or I am doing something wrong.I called $.templates(&#8220;#myTemplate&#8221;) from the console which msanjay suggested and copied\/renamed the anonymous function and get something like this (which looks a bit odd to my untrain<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/0577a89e479b21d7ef4d7284db5b39bd?s=32&amp;d=identicon&amp;r=PG&amp;f=1\" \/><br \/>\nmekkoo<br \/>\njsrender jsviews<br \/>\nSample JSON: https:\/\/gist.github.com\/mekkoo\/6604902I want using $.observable().insert method to object inner array &#8220;items&#8221;. but, I looked error &#8220;Uncaught TypeError: Object # has no method &#8216;insert'&#8221; when method callingpages = \/\/Sample JSON $.ajax calling $.observable(pages).insert(pages.length, {\/\/I want this data to insert to &#8220;items&#8221; array&#8221;item&#8221;: {&#8220;id&#8221;: 3,&#8221;item_name&#8221;: &#8220;Item Name 3&#8243;,&#8221;item_desc&#8221;: &#8220;Item Desc 3&#8243;,&#8221;item_img&#8221;: &#8220;http:\/\/example.com\/sample.png&#8221;},&#8221;values&#8221;: [{&#8220;id&#8221;: 0,&#8221;key_id&#8221;: 0,&#8221;value&#8221;: &#8220;<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/45a89af8025e620812e3b8bd840d6d46?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nArun P Johny<br \/>\njavascript jquery jsrender<br \/>\nI have template this a part:&lt;td&gt;{{=name}}&lt;\/td&gt;]I need check name of null\/empty and not display it.How do this?example:{{#if ($name!= &#8220;&#8221; &amp;&amp; $secondName!= &#8220;&#8221;) }}I get error Uncaught SyntaxError: Unexpected token &amp;&amp;<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/5872fc2acaad3973056a594a71d33184?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nmattmattmatt<br \/>\njavascript jquery google-chrome jsrender<br \/>\nIm getting an Uncaught RangeError: Maximum call stack size exceeded when ever I get to the 4th time calling my paging function getCollection(), I&#8217;m not exactly sure why the problem is happening.. if I commet out the following line:jQuery(&#8216;#card ul&#8217;).append(template.render(data));And uncomment the alert below it (for sanity), it seems to run fine past page 4.I&#8217;m using jQuery 1.7.1 and Boris Moore&#8217;s jsrender library and have never had trouble before rendering even larger data sets asynchronously.v<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/f148b2fabe4f88c40459f8d587b1ce5f?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\npixeline<br \/>\njavascript jquery jsrender<br \/>\nI need to keep a &#8220;colcounter&#8221; variable inside the loop that will be used to fill a jsrender template.Here is my template code&lt;script id=&#8221;datascapeTemplate&#8221; type=&#8221;text\/x-jsrender&#8221;&gt;&lt;div id=&#8221;dsViewport&#8221;&gt;&lt;div class=&#8221;ds-column&#8221; style=&#8221;width:{{:(name.length*100)}}px;&#8221;&gt;&lt;h1 id=&#8221;datascapeName&#8221;&gt;{{:name}}&lt;\/h1&gt;&lt;div&gt;&lt;span id=&#8221;dsToggle&#8221;&gt;toggle&lt;\/span&gt;&lt;\/div&gt;&lt;\/div&gt; {{=colcounter}}{{for sections}}&lt;div class=&#8221;ds-section&#8221;&gt;&lt;h3&gt;{{:label}}&lt;\/h3&amp;<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/de0c4d95afe2acb16200655fa2165ee6?s=128&amp;d=identicon&amp;r=PG\" \/><br \/>\nuser1213831<br \/>\njsrender<br \/>\nI am using jsRender and want to bind events like click, mouse over on elements that get render inside the template. while binding the event , I want to pass the data as a argument. Example :&lt;li id=&#8221;liv_{{:nid}}&#8221; onmouseover=[call some function and pass #data]&gt; &lt;div class=&#8221;qwqw&#8221;&gt;&lt;a href=&#8221;#&#8221;&gt;&lt;\/a&gt;&lt;\/div&gt; &lt;div class=&#8221;&#8221;&gt;&lt;p class=&#8221;we&#8221;&gt;{{:spd}} &lt;span&gt;mph (todo)&lt;\/span&gt;&lt;\/p&gt; &lt;\/div&gt;&lt;div class=&#8221;clear&#8221;&gt;&lt;\/div&gt;I tried the code as me<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/7af78a2adaedbee0b9faf52fd7967365?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nmartonx<br \/>\nphonegap jsrender<br \/>\nI would like to use JsRender in a PhoneGap Jquery Mobile project. When I run my application in a simple browser (for example Firefox), everything works fine. When I run the application in Android emulator I get the following error in console:D\/CordovaLog(603): file:\/\/\/android_asset\/www\/js\/program.js: Line 45 : TypeError: Result of expression &#8216;$(&#8220;#vehicletemplate&#8221;).render&#8217; [undefined] is not a function.Please advice. Is there anybody who try JsRender in Phonegap with Jquery Mobile on Android 2.1?<\/li>\n<\/ul>\n<p>Web site is in building<\/p>\n<p>I discovery a place to host code\u3001demo\u3001 blog and websites.<br \/>\nSite access is fast but not money<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.m5zn.com\/newuploads\/2014\/01\/30\/jpg\/e7da807964b1fff.jpg\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Gajotres jquery phonegap jquery-mobile I am using $.mobile.changePage to transit on a new page upon clicking on listview element.This is how I am using it,$(&#8216;ul&#8217;).children(&#8216;li&#8217;).on(&#8216;click&#8217;, function () {created_date = $.trim($(this).text());$.mobile.changePage( &#8220;Image.html&#8221;, {transition: &#8216;slide&#8217;,reverse: &#8216;true&#8217;}); });This is the html page&lt;div data-role=&#8221;page&#8221; id=&#8221;SavedImage&#8221; &gt;&lt;div data-role=&#8221;header&#8221;&gt;&lt;h1&gt;&lt;\/h1&gt;&lt;a href=&#8221;#&#8221;&gt;&lt;\/a&gt;&lt;\/div&gt;&lt;div data-role=&#8221;content&#8221;&gt;&lt;img src= landei osx phonegap path cordova I have a problem [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-6905","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6905","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=6905"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6905\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=6905"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=6905"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=6905"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}