开发者

url path [jQuery]

开发者 https://www.devze.com 2023-02-20 10:33 出处:网络
I use jQuery function: $(document).ready(function(){ $(\"#img\").load(\"loader.php .allcon,\",function(){

I use jQuery function:

$(document).ready(function(){
    $("#img").load("loader.php .allcon,",function(){
    $(".allcon").attr();
    });
});

so HTML code output:

<div class=开发者_C百科"1">
 <div class="2">
   <a href="/xxxx/xxxx.html">
 </div>
</div>

URL target output: "localhost/xxxx/xxxx.html"

There will be a way to make URL: http://website.com/xxxx/xxxx.html


More about .each().

$('a').each(function(i) {
    var _o = $(this).attr('href');
    $(this).attr('href', 'http://website.com/' + _o;
});
0

精彩评论

暂无评论...
验证码 换一张
取 消