I'm using JQuery UI to create a tab, and I want to the contents of my php file to be entered into this tab. I start by creating a tab, and then selecting it.
function createTab2() {
//create a tab
$("#tabs").tabs("add","#tabs-2","Second Tab");
$("#tabs-2").css("display","block");
$('#tabs').tabs('select', "#tabs-2");
$.get('tab2.php', function(data) {
$('.result').html(data);
alert('Load was performed.');
});
}
I tried using the JQuery .get function to return the data and it works fine as an alert appears. However, the contents are not entered into the tab - I just see them listed in my Javascript console.
How can I make the contents of the php file appear in this tab?