中断网址 [英] Break URL

查看:68
本文介绍了中断网址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是URL

http://sl-eida-dev02/zh-CN/Communities/Comm0451

http://sl-eida-dev02/en/Communities/Comm0451

,并根据不同的网站进行更改

and it be changed depending on site like

http://sl-eida-dev02/zh-CN/Communities/Comm04510

http://sl-eida-dev02/en/Communities/Comm04510

http://sl-eida-dev02/zh-CN/Communities/Comm04515

http://sl-eida-dev02/en/Communities/Comm04515

我想提取或我需要这个(下面提到)

i want to extract or i need this ( below mention )

所需的URL:

http://sl-eida-dev02/zh_CN/社区

http://sl-eida-dev02/en/Communities

如何我破坏网址以获得所需的网址

How can  i break url to get desired url

谢谢

推荐答案

 

尝试以下脚本...

  

  

< script>

     var fullurl ="http://sl-eida-dev02/zh-CN/Communities/Comm04510";

     desiredURL = fullurl.substr(0,fullurl.lastIndexOf('/')); 

<script>

      var fullurl= "http://sl-eida-dev02/en/Communities/Comm04510";

     desiredURL= fullurl.substr(0,fullurl.lastIndexOf('/')); 

</script>

请记住,将您的问题标记为已回答",如果这可以解决您的问题.

Please remember to mark your question as "answered" if this solves your problem.


这篇关于中断网址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆