Xml
<?xml version="1.0" encoding="utf-8"?>
<Questions>
<Question>
<Id>1</Id>
<Text>aaaa</Text>
</Question>
<Question>
<Id>2</Id>
<Text>bbb</Text>
</Question>
</Questions>
HTML
<table dir="rtl" width="400px">
<tr>
<td>
<span id="signuptitle">ques* : </span>
</td>
<td>
<select id="sctQuestion" name="D2">
<option></option>
</select>
</td>
</tr>
Code1
function PopupUserRegist() {
$.ajax({
type: "GET",
url: "../Administrator/Questions.xml",
success: parseXmlQuestion
});
function parseXmlQuestion(xml)
{
$(xml).find("Question").each(function()
{
var value=$(this).find('Text').text();
$("#sctQuestion").
append($("<option></option>").
attr("value",value).
text(value));
});
}
$("#div_userregist").dialog("open");
}
$(function () {
$("#dialog:ui-dialog").dialog("destroy");
$("#div_userregist").dialog({ autoOpen: false,
buttons: {
"ok!": function () {
}
});
});
Этот код Получить XML успехов.
=============================================== ===========================
Кодекса2
function PopupUserRegist() {
$.ajax({
type: "GET",
url: "../Administrator/Questions.xml",
success: parseXmlQuestion
});
function parseXmlQuestion(xml)
{
$(xml).find("Question").each(function()
{
var value=$(this).find('Text').text();
$("#sctQuestion").
append($("<option></option>").
attr("value",value).
text(value));
});
}
$(function () {
$("#dialog:ui-dialog").dialog("destroy");
$("#div_userregist").dialog({ autoOpen: true,
buttons: {
"ok!": function () {
}
});
});
}
Этот код не получает XML-успехов.
=============================================== ==================
=============================================== ==================
в Code1: autoOpen: false и в code2: autoOpen: true
в code1 - успешное выполнение xml, но в code2: не получает XML.