Js get item primary domain name and get uri parameter parse return result gadgets, jsuri

Source: Internet
Author: User

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 );}});








Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.