Click here to Skip to main content
15,886,137 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How to Display Popup on ajax Webservice Success Event
Posted
Comments
Sergey Alexandrovich Kryukov 13-Feb-15 0:37am    
What have you tried so far?
—SA
Dinesh92d 13-Feb-15 0:44am    
success: function (data) {

for (var i = 0; i < data.d.length; i++) {

$('#tblspop').append("<tr><td align='center' style='width:auto'>" + data.d[i].Name + "</td><td align='center' style='width:auto'>" + data.d[i].City + "</td></tr>");
}
}




This is my code in success event I want to have automatically pop on table id tblspop
Sergey Alexandrovich Kryukov 13-Feb-15 0:50am    
This is not pop-up, this is adding some "regular" content to some HTML element, which is not enough. Please see my answer.
—SA
Dinesh92d 13-Feb-15 0:52am    
I want have ajax service success event display pop on retrieved data on table tblspop. To Display PopUP on tblspop Table With in the Service .

1 solution

I would not advise you to do a "real" popup, such as window.open or alert:
http://www.w3schools.com/jsref/met_win_open.asp[^],
http://www.w3schools.com/jsref/met_win_alert.asp[^].

Pop-ups are considered very annoying, and alert is more suitable for primitive debugging. Many uses would use browser plug-ins or options for pop-up blocking. For really nice behavior, it's much better to use simulated modal behavior on the same page, such as jQuery Dialog:
http://jqueryui.com/dialog[^].

There are many other similar solutions collectively known as modal pop-up, with all kinds of design: http://bit.ly/1KQXvGS[^].

This CodeProject article can also be useful: JavaScript Modal Popup Window[^].

—SA
 
Share this answer
 
Comments
Dinesh92d 13-Feb-15 0:55am    
I want have ajax service success event display pop on retrieved data on table tblspop. To Display PopUP on tblspop Table With in the Service .
Sergey Alexandrovich Kryukov 13-Feb-15 1:37am    
All right. Didn't I answer your question? Please read the referenced material thoroughly.
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900