Klaus Talkenberger
asked on
JQuery Events doesn't work after reload PHP with JQUERY .load()
Hello Experts
I have a little Problem ...
I have to reload a PHP-Script per JQuery .load()
The PHP-Script includes a Button that triggers a JQuery .click() event.
The .click() Event reload the PHP-Script in a DIV ...
After reloading the Script, the .click() doesn't work ...
here is my code for examle ...
index.php
and her the PHP-Script for load/reload ...
load.php
I hope anyone can help
Thanx
Talki
I have a little Problem ...
I have to reload a PHP-Script per JQuery .load()
The PHP-Script includes a Button that triggers a JQuery .click() event.
The .click() Event reload the PHP-Script in a DIV ...
After reloading the Script, the .click() doesn't work ...
here is my code for examle ...
index.php
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.0/jquery.min.js"></script>
<style type="text/css">
#testdiv h2.h2newcolor {
color: #00FF00;
}
</style>
</head>
<body>
<div id="testdiv">
<?php
include 'load.php';
?>
</div>
<script type="text/javascript">
$('#mybutton').click(function(){
$("#testdiv").load("load.php");
alert('loading ready');
});
</script>
</body>
</html>
and her the PHP-Script for load/reload ...
load.php
<?php
echo "<h2 class=\"h2newcolor\">MyNewTitle</h2><br />\n";
echo "<input type=\"button\" id=\"mybutton\" />\n";
?>
I hope anyone can help
Thanx
Talki
ASKER
hello ...
that's right ...
but i have to lode more than one div's ...
in this case jquery is two, three or fourtimes in the html source ...
i dont know if this make any problems or more than one events are running ...
thanx
talki
that's right ...
but i have to lode more than one div's ...
in this case jquery is two, three or fourtimes in the html source ...
i dont know if this make any problems or more than one events are running ...
thanx
talki
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
good idea ...
i think this can be the right way ... i try it ;-)
thanx
talki
i think this can be the right way ... i try it ;-)
thanx
talki
ASKER
hi,
i'am ready with testing, and it works very fine ...
thanx for your fast help ...
bye
talki
i'am ready with testing, and it works very fine ...
thanx for your fast help ...
bye
talki
You can try including the JS script inside the load.php, like this:
Open in new window