function Getimgdomain () {return "http://imgupload.youboy.com/";} /** Get root directory **/function Getrootpath () {//Get current URL, such as: http://localhost:8083/uimcardprj/share/meun.jsp var curwwwpath= Window.document.location.href; Get the directory after the host address, such as: uimcardprj/share/meun.jsp var pathname=window.document.location.pathname; var pos=curwwwpath.indexof (pathName); Get host address, such as: http://localhost:8083 var localhostpaht=curwwwpath.substring (0,pos); Gets the project name with "/", such as:/uimcardprj var projectname=pathname.substring (0,pathname.substr (1). IndexOf ('/') +1); alert (Curwwwpath); alert (pathName); Alert (POS); alert (LOCALHOSTPAHT); alert (projectName); return (localhostpaht+projectname);} function GetRootPath2 () {//Gets the current URL, such as: http://localhost:8083/uimcardprj/share/meun.jsp var curwwwpath= Window.document.location.href; Get the directory after the host address, such as: uimcardprj/share/meun.jsp var pathname=window.document.location.pathname; var pos=curwwwpath.indexof (pathName); Get host address, such as: http://localhost:8083 VAR localhostpaht=curwwwpath.substring (0,pos); return (LOCALHOSTPAHT);} function Resolveresultbeanisok (data,status) {if (status== "Success") {if (data.isok==true| | data.isok== ' true ' | | data.message== "SUCCESS") {Yb.alert ("Operation succeeded!"); return true;} else{Yb.alert ("Operation failed:" +data.message); return false;} }else {//Alert (json.stringify (data)); Yb.alert ("Operation failed:" +data.message); return false; }/** Display Information **/function getquerystring (name) {var reg = new RegExp ("(^|&)" + name + "= ([^&]*] (&|$)", "I"); var r = Window.location.search.substr (1). Match (reg); if (r = null) return unescape (r[2]); return "";}
$ (function () { var msg=getquerystring ("msg"); if (msg!= "") { if (msg== "4003") { msg= "no operation permission!";} else if (msg== "5001") { msg= "read file exception!";} else if (msg== "5002") { msg= "resolves an xls file exception!";} else if (msg== "5003") { msg= "writes data exception!";} Yb.alert (msg);} });
JS get item primary domain and get URI parameter parse return result gadget