Are you first timer at lazacode.org? Why not join us and start exchange your programming knowledge with everyone. Register today!

jQuery - global variable

0 votes
35 views
added Jun 19, 2018 in jQuery by LC Marshal Captain (25,840 points)
// var
var getProjname = $('.project-detail ul li:first-child .i-list-data').text(),
    outlookPLislnk = 'https://alice.edgeprop.my/property/v1/nsearch?&keyword=', 
    fullPLislink = outlookPLislnk + getProjname;

//declare global variable, outside function
var pslList;
$.getJSON(fullPLislink, function(projectCountSale) {
  var property_data = '';
  $.each(projectCountSale.property, function(index, row) {
  });
  pslList = projectCountSale.found;
  $('input#count-sale').val(pslList).digits(); 
  $('.count-sale').fadeIn(300);
});

//all properties summary
var propSale = parseInt(porList),
    propRent = parseInt(pslList),  
    allProp = (propSale) + (propRent); 
// alert(propSale+propRent);

$('input#count-project').val(allProp); 
$('.count-project').fadeIn(300);

Please log in or register to response this reference.

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...