jQuery Thickbox supporting primarily the dialog handling HTTP GET. This is understandable since the API so the slideshow corner comes in usually by new pictures
a href
be requested and displayed in a dialog box.
If you want to use the API, however, in a web application for use of web2.0 dialog boxes (layers), it happens frequently that you want to post data from the dialog box and then want to display another dialog box.
scenario:
Login Box
à
link (a href) I forgot my password I forgot my password box
à à
email address and query and Server Post
à
Email verschickien with newly generated password's
à
login box.
Here is that code must be on the Submit button. ...
$ (document) ready (function () {
$ ("# btn_send") click (function () {$
ajax ({
type: "POST", url
: $ ( .? "width = 400" '# rememberPasswordForm') attr ('action')
+,
dataType: "html",
data. $ ('# rememberPasswordForm'), serialize () ,
success: function (data) {
/ / set content to DIABOX and reinitalize thickbox
$ ("# TB_ajaxContent") html (data);.
$ ("# TB_load) . remove ();
tb_init ("# TB_ajaxContent a.thickbox"); $ ("# TB_window) css ({display:" block "});. ); $ ( .. btn_close ") click (tb_remove);});
The interesting part here is the callback function (success: function (data) ...). In it, the Thickbox code for displaying the returned page is located. Here, besides the representation not incorporated the initialization, so that in the "new" dialog box and the Thickbox functions are available.
0 comments:
Post a Comment