我获取的背景图片是这样的:
  url("http://zopen.easydo.cn/files/public/example.jpg/++scales++large")我想获取一个链接地址就是这个:
  http://zopen.easydo.cn/files/public/example.jpg怎么得到,谢谢了

解决方案 »

  1.   

    alert(str.replace("\/++scales++large", "").replace("url\(\"","").replace("\"\)",""));
      

  2.   

    var start_loc = str.indexOf ("http://");
    var end_loc = str.lastIndexOf (".jpg");
    end_loc += 4;
    alert(str.slice(start_loc, end_loc);
      

  3.   

    var a = 'url("http://zopen.easydo.cn/files/public/example.jpg/++scales++large")';
    alert(/(http:\/\/.+\.jpg)/g.exec(a)[1]);
      

  4.   

    var a = 'url("http://zopen.easydo.cn/files/public/example.jpg/++scales++large")';
    var b = a.split('"')[1].split('/');
    b.pop();
    alert(a.join('/'));
      

  5.   

    var a = 'url("http://zopen.easydo.cn/files/public/example.jpg/++scales++large")';
    var b = a.split('"')[1].split('/');
    b.pop();
    alert(b.join('/'));
      

  6.   

    var a = 'url("http://zopen.easydo.cn/files/public/example.jpg/++scales++large")';
    alert(/(http:\/\/.+\.jpg)/g.exec(a)[1]);
      

  7.   

    var a = 'url("http://zopen.easydo.cn/files/public/example.jpg/++scales++large")';
    var b=/(http:\/\/.+\.jpg)/ig.match(a)[0];
    alert(b);