dojo.io.iframe._fireNextRequest
dojo.require("dojo.io.iframe");
defined in dojo/io/iframe.js
Usage
var foo=new dojo.io.iframe._fireNextRequest(); (view source)
try{ if((this._currentDfd)||(this._dfdQueue.length == 0)){ return; } var dfd = this._currentDfd = this._dfdQueue.shift(); var ioArgs = dfd.ioArgs; var args = ioArgs.args; ioArgs._contentToClean = []; var fn = dojo.byId(args["form"]); var content = args["content"] || {}; if(fn){ if(content){ // if we have things in content, we need to add them to the form // before submission var pHandler = function(name, value) { var tn; if(dojo.isIE){ tn = dojo.doc.createElement("<input type='hidden' name='"+name+"'>"); }else{ tn = dojo.doc.createElement("input"); tn.type = "hidden"; tn.name = name; } tn.value = value; fn.appendChild(tn); ioArgs._contentToClean.push(name); }; for(var x in content){ var val = content[x]; if(dojo.isArray(val) && val.length > 1){ var i; for (i = 0; i < val.length; i++) { pHandler(x,val[i]); } }else{ if(!fn[x]){ pHandler(x,val); }else{ fn[x].value = val; } } } } //IE requires going through getAttributeNode instead of just getAttribute in some form cases, //so use it for all. See #2844 var actnNode = fn.getAttributeNode("action"); var mthdNode = fn.getAttributeNode("method"); var trgtNode = fn.getAttributeNode("target"); if(args["url"]){ ioArgs._originalAction = actnNode ? actnNode.value : null; if(actnNode){ actnNode.value = args.url; }else{ fn.setAttribute("action",args.url); } } if(!mthdNode || !mthdNode.value){ if(mthdNode){ mthdNode.value= (args["method"]) ? args["method"] : "post"; }else{ fn.setAttribute("method", (args["method"]) ? args["method"] : "post"); } } ioArgs._originalTarget = trgtNode ? trgtNode.value: null; if(trgtNode){ trgtNode.value = this._iframeName; }else{ fn.setAttribute("target", this._iframeName); } fn.target = this._iframeName; fn.submit(); }else{ // otherwise we post a GET string by changing URL location for the // iframe var tmpUrl = args.url + (args.url.indexOf("?") > -1 ? "&" : "?") + ioArgs.query; this.setSrc(this._frame, tmpUrl, true); } }catch(e){ dfd.errback(e); }