如何在没有页面重新加载的情况下调用jquery弹出窗口 [英] How do I call a jquery popup with out page reload
本文介绍了如何在没有页面重新加载的情况下调用jquery弹出窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的要求是,
我在aspx页面中有一个按钮,当我点击按钮它应该从db获取一些数据并需要做一些逻辑在服务器端。如果结果为true,则处理数据后我需要调用popup1,如果是false则弹出,不用重新加载页面。
注意:使用jquery对话框和div在同一页面上一起弹出
先谢谢
解决方案
您需要的是 AJAX [ ^ ],我的朋友。
当你点击按钮时,你必须使用jQuery Ajax从数据库中检索数据。之后根据真/假的情况加载你的弹出窗口。
我希望您使用的是ASP.net网页表单:(示例代码段)
< pre lang =xml> < script type = text / javascript >
function getSentence(){
.ajax(
{
url:default.aspx,
data:get = sentence,
成功:函数(数据)
{
My requirement is ,
I have one button in the aspx page when i click on the button it should fetch some data from db and need to do some logic in server side. After processing the data if result is true then i need to call popup1 and if it is false then popup2 with out reloading the page.
Note : using jquery dialog and a div in the same page together to make popup
Thanks in Advance
解决方案
What you need is AJAX[^], my friend.
Here you have to use jQuery Ajax for retrieve the data from the DB, when you click the button.After that load your popups according to the true/false situation.
I hope you're using ASP.net web forms: (sample code snippet)
<script type="text/javascript"> function getSentence() {
.ajax( { url: "default.aspx", data: "get=sentence", success: function (data) {
这篇关于如何在没有页面重新加载的情况下调用jquery弹出窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文