Languages

Menu
Sites
Language
JQuery working in unpredictable ways.

Hey.

I'm trying to make a wearable app using Tizen Studio. 

I started off with the UI Components Sample project as a template for my program.

I also went to JQuery and downloaded the latest version and added it to my project as so:

<script src="js/circle-helper.js"></script>
<script src="lib/jquery.min.js"></script>
<script src="js/app.js"></script>
<script src="js/lowBatteryCheck.js"></script>
<script src="lib/tau/wearable/js/tau.js"></script>
 
However, when I try to use an ul, set it an ID and try manipulate it using JQuery, I get unexpected results as if the list doesn't exist. 
 
Example Operations I may be trying:
if(list.length>1){
console.log("entered removing...");
while(list.length!=1){
list.last().remove();
console.log("removing...");
}
 
}
$('#nearbyList').append('<li class=\"ui-li-grid\"> <div>Finding Location</div> <div class=\"ui-processing\"></div></li>');//processing animation
 
The List I am trying to edit:
<ul class="ui-listview" id="nearbyList">
<li class="ui-listview-divider">Nearby</li></ul>
When I append the processing li, it appears behind the Nearby Divider, not below it like normal. I'm predicting its not being added to the same list the divider is in at all.
 
 
By using the debugger menu, I can see that the html code is completely different from what's in Tizen Studio, likely cause of TAU.
 
Thus, Jquery cannot edit the HTML correctly since TAU replaced everything I'm assuming. 
  
How can I manipulate DOM elements preferably through JQuery so I can edit the GUI as I please? 
 
I'm using Wearable 5.0 and TAU ns.version '0.13.35'
 
Thank you for your help.

 

Edited by: Ryan Samarakoon on 09 Nov, 2018

Responses

1 Replies
K Johnson

Would you please provide your full source code here?