How can i change the url with jquery

ساخت وبلاگ

آخرین مطالب

امکانات وب

Vote count: 0

I'm totally new in jquery and userscripts. Can someone help me with this:


   

I want to change one word in the url. (blurr) in to (default)


   

How can i do this?

$(function () {
    $(".profile-img").html($(".profile-img").html().replace("blurr", "default"));

    });
asked 4 mins ago
Nisse Karlsson

2 Answers

Vote count: 0

You have to acceed to the SRC atribute

$(".profile-img").attr('src',$(".profile-img").attr('src').replace("blurr", "default")); 
answered 41 secs ago
Roy

Vote count: 0

var url = $(".profile-img").attr("src");
var url = url.replace("blurr", "default");
$(".profile-img").attr("src",url);

https://www.w3schools.com/code/tryit.asp?filename=FQI3GTEMQDE6

answered 33 secs ago
Umesh Aawte
...
نویسنده : استخدام کار بازدید : 21 تاريخ : پنجشنبه 30 فروردين 1397 ساعت: 15:58

close
تبلیغات در اینترنت