Reputation: 1
I'm trying to this. When I click on string "Information Tech" labelled #IT it will load a text file called "InfocommTechnology.TXT" and display it in a window labelled #desc
This is my code.
$(document).ready(function() {"use strict";
$("#IT").click(function() {
$.ajax({
src : "InfocommTechnology.txt",
dataType: "text",
success : function (data) {
$(".desc").html(data);
}
});
});
});
Upvotes: 0
Views: 64
Reputation: 178011
How about
$(function() {
$("#IT").click(function() {
$(".desc").load("InfocommTechnology.txt");
});
});
Upvotes: 1
Reputation: 1011
Check docs http://api.jquery.com/jquery.ajax/
Use 'url' instead of 'src'.
Upvotes: 0