$.mobile.path.get(url);//获取URL地址的目录部分,就是除了a.html之外的那部分

jQuery.mobile.path.getDocumentBase(bool) //获取文档地址的根目录,默认参数为false,返回一个对象,如果是false,返回一个当前URL字符串,如http://localhost:4479/www/login.html

path方法总结

jQuery.mobile.path.getDocumentUrl(bool) 这个方法和jQuery.mobile.path.getDocumentBase(bool)是一样的

 

jQuery.mobile.path.getLocation() 等同于jQuery.mobile.path.parseLocation() 返回当前URL

 

jQuery.mobile.path.isAbsoluteUrl( url ) 判断url是否是绝对路径 ,如果是绝对路径返回true,否则返回false,如

jQuery.mobile.path.isAbsoluteUrl('http://localhost:4479/www/login.html');//ture 

jQuery.mobile.path.isAbsoluteUrl("//foo.com/a/file.html" ) ;//false

jQuery.mobile.path.isRelativeUrl( url ) 判断URL是否是相对路径,是返回true,否则返回false

jQuery.mobile.path.isSameDomain(url1, url2),判断两个URL地址是否在同一个域名下,是返回true,反正false

 

jQuery.mobile.path.makePathAbsolute( relPath, absPath ) //将第一个相对路径的URL或者文件变为绝对路径

 

jQuery.mobile.path.makeUrlAbsolute( relUrl, absUrl ) 将相对路径变为按指定格式的绝对路径

$.mobile.path.makeUrlAbsolute( "../../foo/file.html", "http://foo.com/a/b/c/test.html" ) 结果:http://foo.com/a/foo/file.html

 

 

 

相关文章:

  • 2021-08-04
  • 2022-03-03
  • 2021-11-20
  • 2021-10-19
  • 2021-11-07
  • 2021-11-17
  • 2022-01-26
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-25
  • 2021-11-13
  • 2022-01-28
  • 2021-11-28
  • 2022-12-23
相关资源
相似解决方案