Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-02-2011, 09:47 PM   PM User | #1
justletgo
New to the CF scene

 
Join Date: Oct 2011
Location: london
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
justletgo is an unknown quantity at this point
Help needed with 'simple' SEO JavaScript form

Hi Coders...

I'm building a 'really simple' JavaScript program to help editors write SEO-friendly META titles and META descriptions. The idea is you have 3 text boxes, each on a separate line:

BOX 1 - META TITLE [ i.e. "Cool website page" ]
BOX 2 - FILE NAME [ i.e. "This is a really cool web page about cool stuff"]
BOX 3 - META DESCRIPTION [ i.e. "cool-web-page" ]

As the editor types in the boxes, a serp listing is displayed as it would appear on Google (and ideally how it would appear on Bing and Yahoo):

Cool website page
www.coolwebsite.com/cool-web-page
This is a really cool web page about cool stuff

Kudos to any one who could point a JavaScript newbie in the right direction
justletgo is offline   Reply With Quote
Old 10-03-2011, 12:40 AM   PM User | #2
rangana
Senior Coder

 
rangana's Avatar
 
Join Date: Feb 2008
Location: Cebu City, Philippines
Posts: 1,752
Thanks: 65
Thanked 372 Times in 365 Posts
rangana will become famous soon enoughrangana will become famous soon enough
Hope this gets you started:
Code:
<script type="text/javascript">
function update(el, target) {
	document.getElementById(target).innerHTML = el.value;
}
</script>
<label for="title">Meta Title: </label><input id="title" onkeyup="update(this, 'el_title')" type="text"><br>
<label for="file_name">File Name: </label><input id="file_name" type="text"><br>
<label for="meta_desc">Meta Description: </label><input id="meta_desc" onkeyup="update(this,'el_meta')" type="text"><br><br>

<fieldset style="width:400px;border:1px solid #999"><legend>...as appears on Google</legend>
	<strong style="color:#00f;font-size:12pt;" id="el_title">Cool website page</strong><br>
	<span style='color:green;'>www.coolwebsite.com/cool-web-page</span><br>
	<span id="el_meta">This is a really cool web page about cool stuff</span>
</fieldset>
__________________
Learn how to javascript at 02geek

The more you learn, the more you'll realize there's much more to learn
Ray.ph
rangana is offline   Reply With Quote
Users who have thanked rangana for this post:
justletgo (10-05-2011)
Old 10-05-2011, 07:22 PM   PM User | #3
justletgo
New to the CF scene

 
Join Date: Oct 2011
Location: london
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
justletgo is an unknown quantity at this point
Really appreciate your help on this Ray. Code works a treat. I'm gonna have a lot of fun tweaking it now. Kudos to you sir!
justletgo is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:59 PM.


Advertisement
Log in to turn off these ads.