function getRandomInt(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
var myAnswerRandomFileId = getRandomInt(1,3);
$.ajax({
cache: false,
type: "GET",
url: "this_is_fiiiiiile_"+myAnswerRandomFileId+".json",
success: function(msg){
var rnd = msg[getRandomInt(0,msg.length)];
$("#my-unique-div").addClass(rnd.status);
}
});
<ul class="new-control">
<li><a href="#" data-tab="0">Tab one</a></li>
<li><a href="#" data-tab="1">Tab two</a></li>
<li><a href="#" data-tab="2">Tab hree</a></li>
</ul>
$("#tab").tabs();
$(".new-control a").on("click", function(){
$("#tab").tabs("option", "active", $(this).data("tab"));
});