• Welcome to AcornDomains.co.uk, a friendly community for UK domain investors, developers and anyone interested in domain names.

    Whether you're looking to buy or sell domains, learn more about the UK domain market, get feedback on your names, or simply chat with other domainers, you're in the right place. AcornDomains has been bringing together people from across the UK domain industry for many years, from complete beginners to experienced investors.

    Have a look around, join the discussions and, if you haven't already, create a free account and introduce yourself.

Avoid repeating a domain name

ian

Joined
Jan 10, 2008
Posts
4,052
Reaction score
753
The holding page I'm working on currently requires me to enter the domain name a few times in various bits of the html code (and contact form). Is there a way in which I can add the domain name once, and then reference it with some kind of basis code everywhere else, so it is quicker when I set up a new page.

Something like thisismydomain.co.uk, and everywhere else NAME={domain-name}. You get the jist (hopefully!).
 
If you're using a static html page you could include jquery and then wrap something around each occurrence eg <span class="domainName"></span> then just have a piece of code that runs on page load $(".domainName").text("whateverdomainyouwant"); That would change all occurrences
 
Rob's way is ideal. Even if your working in html you can essentially just change the extension to .php and it will work once on server. PHP var defo the way to go.
 
Thanks guys. It is a static page built from HTML, with a php contact form and a few jquery type files for opening stuff on the page. It was a bought option, I didn't create, so I'm struggling a little with the best method...or whether this is a seo no no to mask/hide the name too much?
 
Top Bottom