作者angelmark (湖畔风晴)
看板Ajax
标题[问题] dialog 跳出视窗有问题
时间Fri Jun 11 14:28:30 2010
<input type="button" value="查询" onclick="show_go()">
<div id="text"></div>
<script>
function show_go()
{
year_value = document.getElementById('start_year').value
$('
#show_growth_proposal').text('查询中请稍候');
$.ajax({
url: "/go/show",
data: "year_value=" + year_value
type: "post",
cache: false, //不快取
success: function(html){
$('#text').html(html);
}
});
}
</script>
------------------------------------------------------------
<input type="button" value="储存user_id" onclick="set_user_id()">
<div id="dialog9" title="编辑"></div>
<script>
$(function() {
// Dialog
$('#dialog9').dialog({
autoOpen: false,
width: 800
});
});
function set_user_id()
{
user_id = document.getElementById('user_id').value
$('#dialog9').text("查询中,请稍候");
//jQuery AJAX
$.ajax({
url: "/go/setTarget",
data: "user_id = "+user_id,
type: "post",
cache: false, //不快取
success: function(html){
$('#dialog9').html('<form action="" method="post">' + html + '<p><div>
<input type="button" value="储存" onclick="save_user_id(\''+user_id+'\')">
</div></form>');
$('#dialog9').dialog('open');
}
});
return false;
}
function save_user_id(user_id)
{
//jQuery AJAX
$.ajax({
url: "/go/SaveUserId",
data: "user_id=" + user_id + "&"+$("#dialog9 form").serialize(),
type: "post",
cache: false, //不快取
success: function(html){
$('#dialog9').html('<form action="" method="post">' + html +
'<p><div><input type="button" value="储存" onclick="
save_user_id(\''+ user_id +'\')"></div></form>');
if ($("#dialog9").find("table").text()=='')
{
$('#dialog9').dialog('close');
$('#'+ customer_number + "A").html(html);
}
}
});
}
</script>
在执行第一个html的时候
他秀出网页 底下有个div
当我按下查询时 他会把AJAX所呼叫的html叫到DIV底下
在div里面又有一个按钮叫做 储存user_id
当按下的时候会跳出一个dialog9视窗
显示查询中,请稍候
成功的时候 会秀出另一个html在dialog9的视窗里面
里面有储存的按钮
当我今天不执行储存 而直接按X关闭 此网页不按重新整理
我在回到最上方的网页 在按下查询
一样会在DIV底下就出HTML
一样回到上面的步骤有个按钮叫做储存user_id
当按下此按钮的时候一样弹跳出一个dialog9的视窗
一样显示查询中,请稍候
但是他当下就停在这个画面了 他并不会显示出来成功时候的画面了
意思就是说我在第一次按查询的时候 按下储存user_id会成功跳出dialog9视窗以及内容
但是在不重新整理的情况下 在按一次查询按钮(第二次了)後 在按下储存user_id按钮
一样会跳出dialog9的视窗 但是内容却出不来
请问各位大大有没有办法可以帮我的忙呢
http://www.wretch.cc/album/show.php?i=angelmark&b=2&f=1699244954&p=0
图1点选查询的部分->图2跳出div的TABLE按下按钮->图3跳出dialog然後按XX->
在按下图一的查询->图2跳出div的TABLE按下按钮->然後就跳出图4就不会动的
流程大约如上
希望各位高手大大门能帮我的忙
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 60.250.35.133
※ 编辑: angelmark 来自: 60.250.35.133 (06/11 15:01)