Tuesday, 11 August 2015
  2 Replies
  3.5K Visits
0
Votes
Undo
Hello,
I have js conflict when I activate geo targeting. In backend work's well, but in frontend I can not activate geo buttons. In console I see js conflict in geo.js file. If I remove this part of code, buttons work, but not working selections of cities and countries.

techjoomla.jQuery(".geo_fields")
.autocomplete({
minLength: 0,

source: function( request, response ) {
if(request.term){
var geofields =techjoomla.jQuery(".geo_fields_hidden").serializeArray();
techjoomla.jQuery.ajax({
url: "?option=com_socialads&controller=buildad&task=findgeo&element="+this.element[0].id+"&request_term="+request.term,
type: "POST",
data: geofields,//{geofields:geofields,current:this.value},
dataType: "json",
success: function(data) {
if(data != ""){
availableTags=data;
}
// delegate back to autocomplete, but extract the last term
response( techjoomla.jQuery.ui.autocomplete.filter(
availableTags, extractLast( request.term ) ) );
}
});
// delegate back to autocomplete, but extract the last term
//response( techjoomla.jQuery.ui.autocomplete.filter(
//availableTags, extractLast( request.term ) ) );
}
},
focus: function() {
// prevent value inserted on focus
return false;
},
select: function( event, ui ) {
this.value='';
var add_li='<li class="selection" id="selection-'+this.id+'_'+techjoomla.jQuery(this).index()+'">';
add_li+='<a class="close" id="close-'+techjoomla.jQuery(this).index()+'" onclick="remove_li(\''+this.id+'\','+techjoomla.jQuery(this).index()+',\''+ui.item.value+'\');">×</a>'+ui.item.value+'</li>';
techjoomla.jQuery(this).before(add_li);
availableTags = '';
add_tag(this.id,ui.item.value);
show_hide_others();
return false;
}

});
});

Please help with this issue.
Thank's.