I have a page where I need to have different html loaded into a div on the click of a folder. This kind of works because on click...the div will say hello. I tried to replace "hello" with the html and using ' instead of " but it doesn't work. I have also tried to use .load and .get commands to read from external files. Here are the key parts and my .get and .load command that won't work no matter what I do.
Is their another way to do this? Or is there a way I can use what I have.
jQuery:
$("#one").click(function() {
$("#read").html("hello");
});
HTML:
<div id="read">
</div>
Failed .get:
$("#one").click(function() {
$.get('readfrom/one.txt')
.success(function(data) {
$('#read').html(data);
});
});
Failed .load:
$("#one").click(function() {
$('#read').load('readfrom/one.txt');
});