$.ajax({url: "demo_test.txt", success: function(result){ $("#MainTitleBar").html(result); }}); $.ajax({url: "demo_test.json", dataType: "json", success: function(result){ $("#MainTitleBar").html(result.name); }});