I try to load a text file with button. Without button it works. But with button it doesn' t.
I have this:
$("#lesen").click(function () {
jQuery.get('movie.txt', function (data) {
var lines = data.split("\n");
$.each(lines, function (n, elem) {
$('#content_area').append('<div>' + elem + '</div>');
});
});
});
and this is the html file:
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type ="text/javascript" src="Scripts/jquery-1.10.2.js"></script>
<script type="text/javascript" src="Scripts/JFunc.js"></script>
</head>
<body>
<form id="form1" runat="server">
<div>
<input type="button" id="lessen" value="load" />
<div id="content_area"></div>
</div>
</form>
</body>
</html>
Thank you
I have it now like this:
$("#lessen").click(function () {
alert('lsdjflkjsdf');
jQuery.get('movie.txt', function (data) {
var lines = data.split("\n");
$.each(lines, function (n, elem) {
$('#content_area').append('<div>' + elem + '</div>');
});
});
});
but I even dont see the alert, when I activate the button