View Full Version : Display Text In Page From URL

12-01-2006, 03:53 PM
I have a question for any javascript programmers that know how to do the following.

I would like to display the text from my URL page link in different parts of my web page.

So if I have a page link like the following:


I can then use that keyword name in my page content as follows:

<p>This is a paragraph to show how I would like to display this keyword name here in my content. Today is a great day and I appreciate anyone who can figure out how to display this keyword name. Thanks again to anyone who can help on this idea. I hope I have explained my idea for my keyword name in page content.</p>

Thanks again

12-01-2006, 05:15 PM
Hi there designguru,

does this help...

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<style type="text/css">
#theLink {
#thePar {
border:1px solid #999;
margin:20px auto;
.keyword {

<script type="text/javascript">
window.onload=function() {
for(c=0;c<spn.length;c++) {



<li><a id="theLink" href="http://www.domainname.com/keyword-name.html">http://www.domainname.com/keyword-name.html</a></li>

<p id="thePar">
This is a paragraph to show how I would like to display this <span class="keyword">&nbsp</span> here in my content.
Today is a great day and I appreciate anyone who can figure out how to display this <span class="keyword">&nbsp</span>.
Thanks again to anyone who can help on this idea. I hope I have explained my idea for my <span class="keyword">&nbsp</span>
in page content.


12-01-2006, 07:14 PM
Thanks for all your help...your script works great but I guess there are a couple of issues that I still don't have worked out and it might just be that I can't do what I am wanting to do for this client.

The client wants a website that is seo friendly...They sell products for a company that uses javascript to pull the products into the page and display the inventory for them. So for seo I have created a mod rewrite that can take the url string from the following and convert it to the following.

Original URL:


My Mod Rewrite URL:


Well as you know there is no way of having any rich content in those pages pertaining to that keyword for the page to ever rank or maybe even get indexed. So my imagination wanted to have a preformatted paragraph that could just pull that url Keyword-keyword into the page so that the serps would see that each of the hundreds of product pages have good content and have the keyword throughout the text content.

So the first problem is that I see you have formatted it to work off of me actually putting the url in the page and then it read from that instead of actually reading from the url itself...I can't create thousands of pages for them for each product...I also see that when you view the source of the page and the search engines spider the page, they just see <span class="keyword">&nbsp</span> and not the actual word itself...so it does no benefit.

I know that PHP is the ideal way to go with this but they can't use php because they have everything from the past few years in html format and will lose all there indexed pages etc...plus the serps recognize php as dynamic and kind of defeats the purpose anyway. I am not that familiar with Javascript and I might just be dreaming of this being possible...If so I apologize.

If you know of a solution that maybe uses xml or something that will let me do this and keep the html extension I am up for anything at this point.

Thanks again.

12-01-2006, 11:18 PM
are you wanting this to do it for the url of the page, or a link in the page?

sounds to me like you wnat the page to load and based on what the url of that page is it writes the keywords into the page.

lemme know if this is it.

12-01-2006, 11:51 PM
Yes Brandon you are exactly correct...sorry if I wasn't clear earlier.

I would also like it to print that keyword-name without the dashes in it in the page. So it says keyword name in the paragraph instead of keyword-name.

Your help is greatly appreciated.

12-02-2006, 07:50 AM
the below link is to another thread that i replied to. it deals with something similar. it should point you in the right direction.


EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum