Home >Backend Development >PHP Tutorial >哪位大神帮忙看下,我做了个弹出层增加的时候没问题,但是修改我怎么获取数据?

哪位大神帮忙看下,我做了个弹出层增加的时候没问题,但是修改我怎么获取数据?

WBOY
WBOYOriginal
2016-06-23 13:42:19900browse

有个增加、修改数据我用弹出层进行代替,效果是这样的:
增加没有问题,但是后面我要修改,怎么进行查询数据并在这上面显示呢?

    <script type="text/javascript">      $(document).ready(function() {	        $('#open').click(function() {		  var title = $(this).attr("value");		  $("#add").val(title);          $('#Window1').AeroWindow({			            WindowTitle:          title,            WindowPositionTop:    'center',            WindowPositionLeft:   'center',            WindowWidth:          500,            WindowHeight:         300,            WindowAnimation:      'easeOutCubic'          });        });		      });    </script>

<div id="open">添加</div><style>	  #Window1{display:none;}    </style> <div id="Window1">      <table width="100%" border="0" cellspacing="0" cellpadding="0" class="wenzhang">		<tr>			<td class="bg_f8" align="right" width="110">分类名称:</td>			<td><input type="text" name="info[class_name]" value="" class="inputall input200" /></td>		</tr>		<tr>			<td class="bg_f8" align="right">上级分类:</td>			<td>				<select name="info[class_type]" class="inputselect">								<option value="news" >资讯中心</option>								<option value="help" >帮助中心</option>								</select>			</td>		</tr>		<tr>			<td class="bg_f8" align="right">分类排序:</td>			<td><input type="text" name="info[class_order]" id="add" value="" class="inputall input80" /></td>		</tr>		<tr>			<td class="bg_f8"> </td>			<td><input type="submit" name="pesubmit" value="提 交" class="tjbtn" /></td>		</tr>		</table>    </div>

现在的问题是我怎么在修改的时候查询数据并在这个层上面进行显示?


回复讨论(解决方案)

楼主先弹出层然后在弹出框架,利用jquery替换框架里面src的值

<div id="window"><iframe id='name1' name='name1' src='a.php'></iframe></div>

jquery代码如下:
<script type="text/javascript">      $(document).ready(function() {           $('#open').click(function() {          var title = $(this).attr("value");          $("#name1").attr("src","a.php?你自己拼字符");          $('#Window1').AeroWindow({                       WindowTitle:          title,            WindowPositionTop:    'center',            WindowPositionLeft:   'center',            WindowWidth:          500,            WindowHeight:         300,            WindowAnimation:      'easeOutCubic'          });        });             });    </script>

1楼正解,这个办法挺好

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:php日期加减Next article:php PHP_SAPI