我使用ajax编写了4个脚本,但其中一个脚本在Firefox中不起作用。 它成功地发出警报&它也不会起作用。 我没有错误信息但没有任何反应。 它在IE和IE中运行良好。铬。
这是我的代码:
/* Latest compiled and minified JavaScript included as External Resource */
$.ajax(
{
type: "GET",
url: "../processeur.php",
dataType: "json",
data: dataString,
cache:false,
success: function(response)
{
alert("success");
var options ="";
if(response != null)
{
for(var i=0; i<response.data.length; i++)
{
options +="<option value = '"+response.data[i]+"'>"+response.data[i];"</option>";
}
}
$("#Liberation tbody").append
(
"<tr>"+
"<td align='center'><input class='liberationL' name='liberationL' type='text'/></td>"+
"<td align='center'><input class='serviceL' name='serviceL' type='text'/></td>"+
//liste déroulante des codes projets destinataires
"<td align='center'>"+"<select class='codest' name ='codest' id=listecodes >"+"<option>Aucun</option>"+options+"</select>"+"</td>"+
//"<td align='center'><input class='dateL' name='dateL' type='text'/><span><br>jj-mm-AAAA</span></td>"+
"<td align='center'><input type='text' class='dateL' id='DateF' name='dateL' onclick='javascript:onCalendar_click();'/></td>"+
"<td align='center'><input class='montantL' name='montantL' type='text'/></td>"+
//liste déroulante des types de mouvements
"<td align='center'>"+"<select class='mouvementL' name='mouvementL'>"+"<option value='lc'>LC(-)</option>"+"<option value='vc'>VC(+)</option>"+"<option value='ci'>CI</option>"+"</select>"+"</td>"+
"<td align='center'>"+
"<img src='../images/enregistrer.png' class='btnEnregistrerLiberation'"+"style='cursor: pointer;'/>"+' '+"<img src='../images/supprimer.png' class='btnSuppLiberation'"+"style='cursor: pointer;'/>"+"</td>"+
"</tr>"
);
$(".btnEnregistrerLiberation").bind("click", EnregistrerLiberation);
$(".btnSuppLiberation").bind("click", SupprimerLib);
},
failure: function()
{
alert("error");
}
});
这是我的php代码,其中数据用json_encode编码:
include './BD/T_mouvements.php';
include '../sql.php';
require './jsonwrapper/jsonwrapper.php';
$idProg = $_GET['idProg'];
$exercice = $_GET['exercice'];
$array = array();
$liste = selectionnerListePro($exercice, $idProg);
echo json_encode(array('data'=>$liste));
exit();
答案 0 :(得分:0)
好的,我发现了我的问题。 事实上,我的代码很好但是bug在我的sql.php
中在我之前编码的人,忘了&#34 ;;&#34; ...
谢谢大家:)