...

View Full Version : encodeURIComponent



onepowered
07-17-2007, 02:04 PM
Hello!

I am using encodeURIComponent(document.title) to grab the title for something I need... I was wondering, since my page titles are long and annoying for SEO purposes, can I just get up to the first instance of ":" in the title?

Example page title:
Article Title : Category : Website

I just want to grab the "Article Title" part up to the first ":"!

Thanks for any help!

glenngv
07-18-2007, 03:01 AM
var pageTitle = documen.title;
var arr = pageTitle.split(" : ");
alert(arr[0]);



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum