JS get item primary domain and get URI parameter parse return result gadget

Source: Internet
Author: User



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

Related Article

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.