Make something show only on some parts of a website - help please

I’m kinda stumped here. I have a site where I want to show a html code if the the url is www.tld.com/pris/anythinghere but not if the url is TLD Information Technology specialists without anything more.

Example: I go to CNN.com - Breaking News, U.S., World, Weather, Entertainment & Video News -> nothing shows, then I move on to www.cnn.com/pris/ the html code shows.

I know how to do this with php but I have to use javascript here.

embed jquery in your document.

also, code in an empty div in your markup, with the id “only-if-url”

then, create a separate javascript file and code it something like this:


$(document).ready(function() {
    var pathname = window.location.pathname;
    //do a regex search here for strings starting with (www.tld.com/pris/*anythinghere*)
    //or all of its cousins including those that have http:// before, the ones without www
    //etc., if it matches, then do the following
   {
        $("#only-if-url").html("your dynamic stuff here");
    }
    else
    {
        //do nothing
        return false;
    }
});