Get the App
SLTechnology News&Howtos  ›  Development  › 

How jQuery replaces all URL on a page with a clickable link

Shulou Source: shulou.com Published: 2022-06-01 05:11:48 10月03日 Update

This article is about how jQuery replaces all the URL on the page with a clickable link. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Use a clickable link to replace all URL$.fn.replaceUrl = function () {var regexp = / ((ftp | http | https): / / (wicked: {0jue 1} wicked @)? (S+) (: [0-9] +)? (/ / ([washable flowers. Horse flowers% this /])?) / gi;this.each (function () {$(this). Html ($(this). Html (). Replace (regexp,'$1'));}) Return $(this);} / / usage$ ('# GBin1div'). ReplaceUrl (); Thank you for reading! This is the end of the article on "how jQuery replaces all the URL on the page with a clickable link". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it out for more people to see!

Tags: Links pages content more articles good practical articles read knowledge reference help related Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology OPPO Reno Linux NVidia vpn