• Jie Gou
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 0
    Replies
Hi, 

I am trying to add some logic into lighting component controller, in my understanding, it is javascript, so any old-school javascript should work ? Below is my code which does not work : 

calculateC : function(component, event, helper) {
  var myC = component.get("v.celsius");
       

        var newF = myC*9/5+32;
       
     component.set("v.fahrenheit", newF);           

        if (typeof my !== "number"){
            component.set("v.fahrenheit", 32);
        }
       
},

the part does not work is the typeof 

I tried swipe on HTML, it is working fine. Then I tried the same thing on VisualForce, then it does not work. 

 

$(document).ready(function(){
$("#mainpage").swipeleft(function(){
$.mobile.changePage("#page1");
});

$("#mainpage").bind("swipeleft",function(){
$.mobile.changePage("#page1");
});
});

 

I tried both. No one works. Could anyone show me a working example?

 

Thanks,