SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru JoePrice's Avatar
    Join Date
    Jan 2002
    Location
    UK
    Posts
    673
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Is there a way to make content loaded via ajax indexable WITHOUT using hash fragments

    Hi


    I use ajax to dynamically load content which take a while to load on my website. This means that the site will load without having to wait for the ajax content to be ready.


    The problem is that this ajax loaded content is not indexable by the search engines. I've had a look through numerous tutorials on how to make ajax content indexable, but they all require the use of # hash fragments. Since I want the content to load automatically when a page loads, and not by clicking on a link, this doesn't seem to work.


    Can anyone point me in the right direction in how to make content such as this indexable?


    Here's some ajax code i'm using to load content automatically when a page is loading (which isn't indexable)


    Code:
    function MakeRequest()
    {
      var xmlHttp = getXMLHttp();
      
      xmlHttp.onreadystatechange = function()
      {
        if(xmlHttp.readyState == 4)
        {
          HandleResponse(xmlHttp.responseText);
        }
      }
      xmlHttp.open("GET", "../pageToLoad.php", true); 
      xmlHttp.send(null);
    }
    and then I call the MakeRequest() function in the actual page I wish to insert the content into...


    Many thanks for any replies

  2. #2
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,869
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    The search engines can access the information the same way you provide for those visitors without JavaScript to access it.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •