Skip to content Skip to sidebar Skip to footer

If Html Page Doesn't Have The Special Links, Then Give An Alert With Javascript

A javascript function must search the special links (copyright urls) in a web page (html body). If it doesn't find the special urls, then must give an alert. Example of JavaScript

Solution 1:

It depends on how you write your html. Assuming the footer element is always there:

if (document.getElementById('footer').childNodes.length == 0) {

//If function find the copyright links, then null - don't make anything
}
else
//If function doesn't find copyright links, then give an alert
alert("Please protect original copyright links.")

but remember, this just counts what you put in there.

If your footer is absent if you did not put copyrights in, then see peehaa's comment.

Should be good to note, however, that it looks like you're just referencing links in the copyright area. Like saying - I understand this measure does nothing in the way of security, but in case you care, here are links to the rights owners. If this is true, then goody. Here you go. If you actually want security in place to copyright the content on a page, this will not protect anything.


Post a Comment for "If Html Page Doesn't Have The Special Links, Then Give An Alert With Javascript"