jquery .change after first call ajax
Hello all,
(sorry if my english is bad )
i try to pass my code from a frame developpement to a div
after a first call ajax jquery on change not work
then in frame it's working
i load a first time my page when click on the menu.
function menu_displaycentre(zoneid,url) {
parent.document.getElementById(zoneid).innerHTML ='Please Wait...';
new Ajax.Updater(
zoneid,
url,
{
method:"get"
}
);
return false;
}
after select i select a personnage using PJ_Recherche()
the refresh is ok
but after when i try to modif XPS the event onchange not work
main page
...
the syntax : {$URL_BASE} is from smarty is not the part odf the problem
....
<script type="text/javascript" src="{$URL_BASE}js/prototype.js"></script>
<script type="text/javascript">var URL_BASE='{$URL_BASE}'</script>
<script type="text/javascript" src="{$URL_BASE}js/jquery.min.js"></script>
<script type="text/javascript" src="{$URL_BASE}page.js"></script>
<script type="text/javascript" src="{$URL_BASE}menu_mj.js"></script>
</head>
<body>
...
<div id="frame-menu">
<a href="#" onclick="return menu_displaycentre('frame-centre','{$URL_BASE}page.php');
ma page
</a>
</div>
<div id="frame-centre">
</div>
extract page
<script type="text/javascript" src="{$URL_BASE}js/prototype.js"></script>
<script type="text/javascript" src="{$URL_BASE}js/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="page.js"></script>
</head>
<body>
<form method="post" id="recherche" name="recherche" action="">
<input type="hidden" name="ACT" value="rech_perso" />
RECHERCHE D'UN COMPTE<br />
Id,Login, email, ip ou nom de personnage : (2 lettres min)<br />
<input type="text" name="query" size="30" />
<input type="submit" value="RECHERCHER" onclick="PJ_Recherche()" />
</form>
....
<input type="text" size="10" name="XPS" value="{$PJ.XPS}" id="XPS"/>
page.js
$.noConflict();
jQuery(document).ready(function($) {
$(document).ready(function () {
....
$("#XPS").change(function () {
//$('#XPS').live('onchange',function () {
alert('titi');
var champsid = ($(this).attr('id'))
var champsvaleur = $('input[id=XPS]').val()
var idpj = ($("#idpj").val());
$.ajax({
type: "POST",
url: "updatebdd.php",
data: 'id='+idpj+'&champ='+champsid+'&value='+ champsvaleur,
cache: false,
success: function(html) { // If is everything ok
}
});
});
....
});
});
// Code that uses other library's $ can follow here.
function PJ_Recherche() {
var url=URL_BASE+'page.php';
new Ajax.Updater(
'frame-centre',
url,
{
method : 'post',
parameters: Form.serialize('recherche')
}
);
parent.document.getElementById('frame-centre').innerHTML ='Please Wait...';
return false;
}
...
it not show the alertbox titi when il load page by the ajax call,when in frame mode it ok
someone can help me to resolve this, i block from 3 days.