Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

page keywords into javascript

Status
Not open for further replies.

jazzylee77

Technical User
Jul 21, 2007
3
US
I'm a javascript dunce, but if there is an easy way to do this I would like to fiddle around with it.

basically I'm looking for a way to insert keywords from a pages meta tags into javascript. The end goal being that by carefully choosing my keywords I will get decent results to show.

code is sorta like this. I would like to see the keywords appear where the word bike is.

<script type="text/javascript"><!--
ad_client = "xxxxxxxxx";
ad_campaign = "xxxxxxx";
ad_width = "xxx";
ad_height = "xx";
ad_kw = "bike";

--></script>
<script type="text/javascript" src="</script>
 
I'm looking for a way to insert keywords from a pages meta tags into javascript. The end goal being that by carefully choosing my keywords...

Except that by auto-inserting any old thing with JS, you're hardly "carefully choosing" them, surely?

Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
The "carefully choosing" of keywords would be done when designing the site with this function in mind. I wouldn't slap this on a site whose keywords weren't made without this second use in mind.
 
Umm.

Javascript works client side.
So if the goal of this exercise is some search engine benefit, it won't work since the SE will never see it since they don't 'read' JS.

<honk>*:O)</honk>

Tyres: Mine's a pint of the black stuff.
Mike: You can't drink a pint of Bovril.
 
I understand that much about javascript. I'm wanting to dynamically serve javascript to that client based on meta keywords. Maybe I can do this with php.

Just an idea I had for a site I'm going to develop. I can think of ways to inject the keywords when I generate the pages, basically hard coding different javascript for each page in the process. I may do this in the end since my blind poking at the code I checked out so far hasn't worked out. Problem with this is, I prefer to serve ads with an includes of some sort so if there is a problem I can switch them out sitewide.

If I were better at using php and mysql I would do it dynamically that way, but this site won't use a database except in the development phase, using basically excel to store all data and then generating static pages with html, php and now maybe some javascript from that data.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top