Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 4 of 4
  1. #1
    Junior Member
    Join Date
    Dec 2011
    Posts
    2
    Member #
    30330
    Hi,

    Currently I am working on a small project, and to get the layout I want, I've implemented this script:

    <script type="text/javascript">

    var bustcachevar=1
    var loadedobjects=""
    var rootdomain="http://"+window.location.hostname
    var bustcacheparameter=""

    function ajaxpage(url, containerid){
    var page_request = false
    if (window.XMLHttpRequest)
    page_request = new XMLHttpRequest()
    else if (window.ActiveXObject){
    try {
    page_request = new ActiveXObject("Msxml2.XMLHTTP")
    }
    catch (e){
    try{
    page_request = new ActiveXObject("Microsoft.XMLHTTP")
    }
    catch (e){}
    }
    }
    else
    return false
    page_request.onreadystatechange=function(){
    loadpage(page_request, containerid)
    }
    if (bustcachevar)
    bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
    page_request.open('GET', url+bustcacheparameter, true)
    page_request.send(null)
    }
    function loadpage(page_request, containerid){
    if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))
    document.getElementById(containerid).innerHTML=pag e_request.responseText
    }

    function loadobjs(){
    if (!document.getElementById)
    return
    for (i=0; i<arguments.length; i++){
    var file=arguments
    var fileref=""
    if (loadedobjects.indexOf(file)==-1){
    if (file.indexOf(".js")!=-1){
    fileref=document.createElement('script')
    fileref.setAttribute("type","text/javascript");
    fileref.setAttribute("src", file);
    }
    else if (file.indexOf(".css")!=-1){
    fileref=document.createElement("link")
    fileref.setAttribute("rel", "stylesheet");
    fileref.setAttribute("type", "text/css");
    fileref.setAttribute("href", file);
    }
    }
    if (fileref!=""){
    document.getElementsByTagName("head").item(0).appe ndChild(fileref)
    loadedobjects+=file+" "
    }
    }
    }

    </script>

    My question: Will this affect SEO adversely? As well, does using this script have any other adverse affects? It basically loads separate internal content into a specified <div>, as opposed to loading the entire page - but - I've heard it can hurt in the search engine department. Any advice is greatly appreciated, thank you.

  2.  

  3. #2
    Senior Member Webzarus's Avatar
    Join Date
    May 2011
    Location
    South Carolina Coast
    Posts
    3,322
    Member #
    27709
    Liked
    770 times
    JavaScript tags are generally ignored by search engines, what I mean by that is if a search crawler calls a page that has JavaScript on it, the crawler does not parse or execute the page, so if the page content relies on javascript, then that does affect SEO, but in general no it does not.

  4. #3
    Junior Member
    Join Date
    Dec 2011
    Posts
    2
    Member #
    30330
    The content itself isn't created by the script, but rather called into the div. For example: I can have something written in the index, but when you click say the about link in the navigation, instead of loading about.html entirely, it calls the static content (or database content, however it is set up) from that page into the div. It never actually leaves the basic index page. Being that it works in such a way, never actually going to the page, would the search engine see that? Or, would this be considered JavaScript created content? Thank you very much for your help!

  5. #4
    Senior Member Webzarus's Avatar
    Join Date
    May 2011
    Location
    South Carolina Coast
    Posts
    3,322
    Member #
    27709
    Liked
    770 times
    You may have some issues with this setup, from past research, search engines generally don't call JavaScript, if they don't see any content on the page, they may read the JavaScript to determine if there are any visible URL's to follow, and then follow them.

    Unlike a DB where variables are carried in the URL, using JavaScript to call or load data can have it's drawbacks. There are no absolutes though.

    Just think of a spider like a browser that is only looking for content. Turn off JavaScript, and visit the page, and see the results.


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 01:55 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com