Main BLOGGER
Google
WWW THIS BLOG
Friday, April 17, 2009
 
write content to iframe
using ifrm.doc.open()/write()/close()
But not perfect for IE7 due to some cross-site issue

                function submitFormByAjax(targetId){
                    var form = dojo.byId("tab_form"); // save ref to form
                    dojo.xhrPost( {
                       form: form,
                       load: function(data) {
                          // set the form's HTML to be the response
                          var ifrm = document.getElementById(targetId);
                          /*
                          if(ifrm.contentDocument) 
                             ifrm.doc = ifrm.contentDocument; 
                          else if(ifrm.contentWindow) 
                             ifrm.doc = ifrm.contentWindow.document; 
                          else if(ifrm.document) 
                             ifrm.doc = ifrm.document;                           */
                          ifrm.doc = ifrm.contentWindow.document;
                          ifrm.doc.open();
                          ifrm.doc.write(data);
                          ifrm.doc.close();
                          dijit.byId("loadingDialog").hide();
                       }
                    });
                    dijit.byId("loadingDialog").show();
                }

--
Pop (Pu Liu)




<< Home

Powered by Blogger

Google
WWW THIS BLOG