Leser: 21
1
2
3
4
5
6
7
-anfang-
<script type="text/javascript">
function make_table() {
alert('Dummy');
} //function make_table'
</script>
-ende-
$("#main").html(data.html);
-anfang--ende-
2010-06-07T07:29:26 HagenIrgendwie habe ich den Zusammenhang mit eval (noch) nicht so ganz verstanden, könntest du mir da einen Ansatz geben?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=us-ascii"> <script type="text/javascript" src="jquery-1.4.2.js"></script> <script type="text/javascript"><!-- $(document).ready(function(){ $('#main').html('running...'); $('#change').click( function() { $.get('/cgi-bin/ch.pl', function(data) { $('#main').html(data); } ); } ); }); // --> </script> <title>Test for AJAX + CGI</title> </head> <body> <div id="main"></div> <a id="change" href="#" name="change">Change upper text</a> </body> </html>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#!/usr/bin/perl use strict; use warnings; use CGI qw(:all); my $c = int rand(1000); print header(), '--start--', "\n", qq{ <script type="text/javascript"> alert($c); </script> }, "\$c ist $c", "\n", '--ende--';