Link Alert!!

Subscribe to Link Alert!! 14 posts, 4 voices

 
Tjacobs User

I'm sad with a link can someone make a script that notice me if the image or link i will click is the link "x"

if u dont understand what i want please reply i can explain better

 
jerone Scriptwright

I really don't understand, so if you could explain it better...

 
dob Scriptwright

href = "http://google.com";

function $x(p, context) {
	if (!context) context = document;
	var i, arr = [], xpr = document.evaluate(p, context, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
	for (i = 0; item = xpr.snapshotItem(i); i++) arr.push(item);
	return arr;
}

link = $x("//a[@href='"+link+"']");
if (link.length) {
	link.forEach(function(l) {
		l.setAttribute("onclick", "return confirm('this is your special link!\r\nyou sure?');");
	});
}

 
Tjacobs User

Thats is what i mean...
but i want 3 more features:

☺ add just a part of web site like "www.example.com/new*" or "*.example.*"
☺ can add more than one website
☺ when a site is blocked donot open a window.. just a frame (that i dont must to click yes or not or ok)

thank you alot

 
Tjacobs User

i put my link in:
href = "HERE"
or
link = $x("//a[@href='"+HERE+"']");
???

 
Tjacobs User

please somebody helpme this is a simple script but really very usefull to me

 
znerp Scriptwright

i put my link in:
href = "HERE"
or
link = $x("//a[@href='"+HERE+"']");
???
Either will do, but dob's intention was for you to do so on the top one.

 
Tjacobs User

i did it but the script doesnt work

 
znerp Scriptwright

Well I don't know about the rest of it, but a quick further look tells me that link = $x("//a[@href='"+link+"']"); should actually be link = $x("//a[@href='"+href+"']");. That'll definitely stop it from working.

 
Tjacobs User

no.. its right..

but it dont work

 
Tjacobs User

somebody help me please

 
Tjacobs User

up!

 
Tjacobs User

up

 
dob Scriptwright

how about posting the script you're using?