XIYUETA.COM
源代码:
点击运行
<script src="https://www.xiyueta.com/js/xiyueta.min.js?v36"></script> <script> /* .parse() 解析CSS .getimgarr() 获得CSS样式里图片地址,返回数组 $.log() 在浏览器里显示内容 == document.write() .debug() 显示匹配元素集第一条Html的Dom结构 */ var css="@font-face {\n\ font-family: layui-icon;\n\ src: url(../font/iconfont.eot?v=256);\n\ src: url(../font/iconfont.eot?v=256#iefix) format('embedded-opentype'), url(../font/iconfont.woff2?v=256) format('woff2'), url(../font/iconfont.woff?v=256) format('woff'), url(../font/iconfont.ttf?v=256) format('truetype'), url(../font/iconfont.svg?v=256#layui-icon) format('svg')\n\ }.gds{background:url( '/img/xiyueta.jpg?act=333 ' );color:red}n\ body {\n\ background: url('../images/background.gif?v1') top rgb(255, 255, 255); font: 12px/normal verdana, arial, helvetica, sans-serif; font-size-adjust: none; font-stretch: normal;\n\ }\n\ \n\ .ts_box {\n\ background-position: 15px 15px; padding: 15px 25px 15px 65px; border: 5px solid rgb(240, 240, 240); border-image: none; width: 460px; margin-top: 150px; margin-right: auto; margin-left: auto; background-image: url(\"../images/del.jpg\"); background-repeat: no-repeat;\n\ }\n\ "; xiyuetaCSS().parse(css); $.log( xiyuetaCSS("(all)").getimgarr()); document.write("<br>") xiyuetaCSS().parse(css); $.log( xiyuetaCSS("(all)").getimgarr("fileName")); document.write("<br>") xiyuetaCSS().parse(css); $.log( xiyuetaCSS("(all)").getimgarr("server=http://www.bidu.com/aa/")); document.write("<br>") xiyuetaCSS().parse(css); $.log( xiyuetaCSS("(all)").getimgarr("dir=../../images/")); </script>
运行结果