Js get item primary domain name and get uri parameter parse return result gadgets, jsuri
Function getImgDomain () {return "http://imgupload.youboy.com/";}/** get root directory **/function getRootPath () {// get the current URL, for example: http: // localhost: 8083/uimcardprj/share/meun. jsp var curwwwpathpattern contains invalid Doc ument. location. href; // The directory after obtaining the host address, for example, uimcardprj/share/meun. jsp var pathname=w.doc ument. location. pathname; var pos = curWwwPath. indexOf (pathName); // obtain the host address, for example, http: // localhost: 8083 var localhostPaht = curWwwPath. subs Tring (0, pos); // obtain the project name with "/", for example,/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 () {// obtain the current URL, for example, http: // localhost: 8083/uimcardprj/share/meun. jsp var curwwwpathpattern contains invalid Doc ument. location. href; // The directory after obtaining the host address, such as: uimcardprj/sh Are/meun. jsp var pathname=w.doc ument. location. pathname; var pos = curWwwPath. indexOf (pathName); // obtain the host address, for example, 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 successful! "); 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 =" An error occurred while reading the file! ";} Else if (msg =" 5002 ") {msg =" An error occurred while parsing the xls file! ";} Else if (msg =" 5003 ") {msg =" An error occurred while writing data! ";}Yb. alert (msg );}});