The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
[HELP]someone knowledgable in jQuery
so we have a html link
Code:
<a href="http://google.com">Google</a> Code:
return this.each(function(){ var link = $(this); var url = settings.service .replace("__URL__" , link.attr("href")) .replace("__DOMAIN__", link.attr("href") .replace("http://","").replace("https://", ""));.......more code but i want to target a link like this Code:
<a href="out.php?link=http://google.com">Google</a> i have tried many ways, and looking at this code the obvious replace has been done replace("out.php?link=http://","").replace("out.php?link=https://", "") im stuck, i set a demo up HERE |
#2
|
|||
|
|||
Might be easier to make use of split like this:
HTML Code:
"out.php=?link=http://google.com".split('//')[1] |
#3
|
||||
|
||||
did you take a look at the demo dave? i implemented the split but im still not getting the desired results
--------------- Added [DATE]1457553299[/DATE] at [TIME]1457553299[/TIME] --------------- this is the full code Code:
jQuery.fn.favicons = function(config){ var settings = jQuery.extend({ "classname": "favicon", "service": "http://api.byi.pw/favicon?url=__URL__" }, config); return this.each(function(){ var link = $(this); var url = settings.service .replace("__URL__" , link.attr("href")) .replace("__DOMAIN__", link.attr("href") .replace("http://","").replace("https://", "")); link.css("background-image", "url(" + url + ")") .addClass(settings.classname); }); }; |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|