/    Sign up×
Community /Pin to ProfileBookmark

Hi,
I have made a website using jquery [url]www.findahome.ae[/url] please have a look; eveything is great until I noticed a very stupid mistake! (for now it is just dummy info and images)

Because I used AJAX it is not at all SEO! the most important section of the website (which is the center part) loads using JS and AJAX and therefore can not be viewed by crawlers!

Can someone please take a look at it and tell me if there is anyway I can perhaps have Search Engines read the center and also keep the AJAX functionality.

I was considering it checks if the person is using JS or not, so if not it shows another version and if so it shows the AJAX version, but it seems SE’s see this as “cloaking” and it provides negative marks to my site if it does not become totally banned by the search engine.

Please help me out here.
Thanks.

to post a comment
PHP

7 Comments(s)

Copy linkTweet thisAlerts:
@bokehNov 04.2008 — If you write your AJAX well, when JS is switched on only part of the page is updated, when JS is switched off the whole page is reloaded. All your pages work fine both ways. Trying to do this as a retro fit would probably be more difficult than just starting again.
Copy linkTweet thisAlerts:
@XeroSiSauthorNov 05.2008 — is there a code which can check if the viewer has JS swithed on or off?

In this case will I be penalized by Search Engines who will have a different view than probably +95% of the viewers?
Copy linkTweet thisAlerts:
@bokehNov 05.2008 — is there a code which can check if the viewer has JS swithed on or off?[/QUOTE] There's no code that can test for JS before a page is loaded.In this case will I be penalized by Search Engines who will have a different view than probably +95% of the viewers?[/QUOTE]The view is not important. If you send the exact same HTML page to the search engine as you do to the human client you are doing nothing wrong. What is against the code of practice is sending a different HTML page based on the client being a Google bot or otherwise. A good example would be having a site with protected content (paid subscription) but letting Google freely browse the site. In this case someone does a Google search, Google links to a page with corresponding content, but the human client can't access the page without paying a fee.
Copy linkTweet thisAlerts:
@XeroSiSauthorNov 08.2008 — Well finally what I did was redesign the site without the ajax functionality and I really dont like it and would prefer my viewers to not see it therefore here is my solution; can you please tell me if this is good practice or not:

I created a cookie named ajaxswitch which can either be "on" or "off"

Now if you are a first time viewer in between my <head></head> tags I have put the following:

[code=php]<?if(!$_COOKIE['ajaxswitch']){?><script src="_library/setcookie.js" type="text/javascript"></script><?}?>[/code]

now the setcookie.js looks something like this:
[code=php]function setCookie(){
document.cookie = 'ajaxswitch=on; expires=Fri, 30-Jan-2010 12:00:00 GMT'
setTimeout(' document.location=document.location' ,10);
}[/code]


on <body> I have put:
[code=php]<body<?if(!$_COOKIE['ajaxswitch']){?> onload="setCookie()";<?}?>>[/code]

Simply what this does is it checks if your ajaxswitch is on or off:

if it does not exist it runs a JS which creates the cookie and gives it the value of "on" and reloads the page instantly.

From then on that computer will always have this cookie and ajax always works.

Now if a search engine tries to access my page it can not run JS therefore can not get this cookie hence identifying it as off and shows the pages without AJAX functionality.

It seems to be working fine but I was wondering if this is a good solution or not?
Copy linkTweet thisAlerts:
@bokehNov 08.2008 — Your page shouldn't need to know if JS is turned on. If it does need to know you are serving double content from one URI. That's wrong. Why do you need two pages? Why can't you have one page which works one way with Javascript and the other way without (no reload).
Copy linkTweet thisAlerts:
@XeroSiSauthorNov 08.2008 — but where should the condition be defined?! (and perhaps how?) to act one way or another?
Copy linkTweet thisAlerts:
@bokehNov 08.2008 — but where should the condition be defined?![/QUOTE]It shouldn't be defined, that's the whole point. What you do is build a page that works as you want without JS, except that it reloads every time you change something. Then you add AJAX and it does everything the same except it doesn't reload. The following are two really simple pages that work differently with or without JS, but with the same end result. Just very basic examples but all the same they work both ways. Don't forget to press reloaded after switching JS on or off.

[LIST]
  • [*]http://bokehman.com/javascript_and_php.php

  • [*]http://bokehman.com/do_it_yourself_avatars/

  • [/LIST]
    ×

    Success!

    Help @XeroSiS spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.18,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @AriseFacilitySolutions09,
    tipped: article
    amount: 1000 SATS,

    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,
    )...