#1  
Old 12-27-2007
Jazajay's Avatar
Jazajay Jazajay is offline
 
Join Date: Jul 2007
Location: Leicester, England
Posts: 642
Jazajay has disabled reputation
SEO friendly way of detecting if JS is off

Hi all.
I'm in the process of updating my tracking/product page and I was wondering if any one could notice or give me a better solution than what I have / want to do.

What I need is a more SEO friendly way of detecting if JS is turned off.

What I have at the mo is I set a JS variable to the link then test if the JS variable is on on the receiving page, if it is not JS isn't on.

However this has an obvious drawback, as I have recently noticed, namely the first page viewed wont have the JS URL parameter and always returns as a user has JS off.
I could test the refferer but I will either not enter any thing for that page into the DB or have to assume it is on, when it possibly couldn't be, and making my tracking less than perfect.

I have come up with 4 more solutions but these all have major drawbacks.
1. Create an image in JS with it's source pointing to a php page then set a session on that page. if JS is off the session is set to null then test the session.

2. Set a cookie in JS - test to see if the cookie is set

However for these to work the page must be refreshed, otherwise I have my orginal problem, as in via js redirect - not a way I really wont to go as it will refresh once for users but every page will refresh for the bots.

3. Test the second page and set the 1st page in a session then insert into the DB the JS value. However if I have a major problem with my non-js version and people leave my site because of it before clicking on I will not know of any problems and therefore wouldn't be able to fix them.

4. use get_browser however I for a long reason I cant as of yet use it.

The only practical solution seems to cloak the redirect and cookie any one have any better solutions before I have to implement this?
Hope you all had a good xmas
Thanks for reading
Jaza
Reply With Quote
  #2  
Old 12-27-2007
jimbeetle's Avatar
jimbeetle jimbeetle is offline
 
Join Date: Mar 2006
Location: New York City
Posts: 956
jimbeetle has much to be proud ofjimbeetle has much to be proud ofjimbeetle has much to be proud ofjimbeetle has much to be proud ofjimbeetle has much to be proud ofjimbeetle has much to be proud ofjimbeetle has much to be proud ofjimbeetle has much to be proud ofjimbeetle has much to be proud of
Re: SEO friendly way of detecting if JS is off

Not sure if this will help, but I've seen several variations that use a hidden form field. Basically run a script that sets the value of the form, then test for that value.
Reply With Quote
  #3  
Old 12-27-2007
Jazajay's Avatar
Jazajay Jazajay is offline
 
Join Date: Jul 2007
Location: Leicester, England
Posts: 642
Jazajay has disabled reputation
Re: SEO friendly way of detecting if JS is off

Thanks for your contirbution but that would require a page refresh or another page load to work bringing me back to my problem. Dam spammers thats another reason why I hate them

Last edited by Jazajay : 12-27-2007 at 12:56 PM.
Reply With Quote
  #4  
Old 01-21-2008
Jazajay's Avatar
Jazajay Jazajay is offline
 
Join Date: Jul 2007
Location: Leicester, England
Posts: 642
Jazajay has disabled reputation
Re: SEO friendly way of detecting if JS is off

I've come up with the best solution I can.
Ok create an image in JS point the src at an external page.
So something like

Quote:
<script type="javascript">
var img = document.createElement("img");
img.setAttribute("src","somePage.php?js=on");
</script>
Right, now on the page create a blank object tag pointing to the same page.
<object type="text/plain" data="theSameSiteToTheJsPage.php?name=thisPage"></object>

Ok now on that page create logic similar to below
Quote:
<?php
if(isset($_GET['name']) && isset($_GET['js']))
{
//if the 2 variables are set js is on
session = js is on
insert into db what ever
}
else
{
//else the JS variable is not present so js = off
js = off
insert into db
}
Walla no cloaking needed and pretty simple.
Maybe tomorrow I will publish some more useful JS tips curtsy of Jazajay
we shawl see
Reply With Quote
  #5  
Old 01-21-2008
jimbeetle's Avatar
jimbeetle jimbeetle is offline
 
Join Date: Mar 2006
Location: New York City
Posts: 956
jimbeetle has much to be proud ofjimbeetle has much to be proud ofjimbeetle has much to be proud ofjimbeetle has much to be proud ofjimbeetle has much to be proud ofjimbeetle has much to be proud ofjimbeetle has much to be proud ofjimbeetle has much to be proud ofjimbeetle has much to be proud of
Re: SEO friendly way of detecting if JS is off

He, he, he. You're a real rip, jaz. Good having you around.
Reply With Quote
  #6  
Old 01-21-2008
Jazajay's Avatar
Jazajay Jazajay is offline
 
Join Date: Jul 2007
Location: Leicester, England
Posts: 642
Jazajay has disabled reputation
Re: SEO friendly way of detecting if JS is off

Of coarse it is mate.
As I'm just amazing and slightly god like if I don't say so my self.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Finding a Search Engine Friendly Content Management System rockcoastmedia Search Engine Optimization 16 07-11-2008 11:31 AM
I really need your opinion about a seo friendly shopping cart fdstd Search Engine Optimization 2 12-26-2006 06:50 AM
Search Engine Friendly E-Commerce Design From Ground Up rustybrick Search Engine Marketing 38 03-17-2005 09:57 AM
SE Friendly Free CMS Round Up Nick W Dynamic Website and Technical Issues 6 11-04-2004 03:40 AM
Installing a Powerful - SE Friendly CMS in 10mins Nick W Dynamic Website and Technical Issues 3 09-28-2004 02:39 AM


All times are GMT -4. The time now is 08:10 PM.