SEO for Javascript Site! Help!

5 replies
  • SEO
  • |
Hello everybody,

I was wondering does anyone have any advice for SEO on a Javascript site?

The site in question is my own its in my footer. I am having trouble getting the pages on google. Partly because search engines probably don't know they even exist.

So far about 36 pages have been indexed but I have over 300 pages on the site, which obviously have not been indexed.
When I try to generate a site map for the site it only displays the main page!

The whole website is a javascript site with just a button on each page.
It is basically a random script which just brings you to a random page on my site.

So what I was thinking is if I had a link in the footer relating to each next page. I.e "#1" next page #2 etc then when I was submitting my sitemap to google webmasters it would display all the pages on my website no?

They might not be indexted but even if I got an extra 50 or so pages it would somewhat help my ranking?

Your thoughts are welcome!

THE LINK TO MY SITE IS IN MY SIG. Thanks again for any help.
#cam chat #javascript #seo #site #watchthiscam
  • Profile picture of the author palmer9999
    Anyone? :confused:
    {{ DiscussionBoard.errors[3996405].message }}
  • Profile picture of the author bestbuddy1986
    the easiest is using javascript’s document.write:


    <script type="text/javascript">
    document.write('Hello World');
    </script>

    This works great for simple little messages, but what if you have a large multi-line text string? What if your text has HTML tags and double quotes in it? Then you’re in for some trouble, because the nice little javascript examples will die on you most ingloriously. PHP to the rescue. Use PHP to replace the spaces (and double-quotes)… you may have to escape your double-quotes in the source text.

    Extending that simple little example with some meaty text and some PHP, you end up with something like this:


    <?php

    $text = ”
    <p>
    Hello,
    big, multi-line
    \”stuff\”, watch out!
    </p>
    “;

    $text = preg_replace(“/\s+/”,” “,$text);
    $text = preg_replace(‘/\\”/’,”””,$text);

    ?>

    <script type=”text/javascript”>
    document.write(‘<?php echo $text; ?>’);
    </script>

    That solution works (at least, it did before I had to replace all the tags with html entities to make this post). The text gets written at that point in the document once it loads on the client-side. Notice that the regular expressions replace double-quotes with 2 single quotes (tricky, eh?), and any excessive space is replaced. But what if you want something more complicated… what if you don’t like the regular expressions and having to escape your double-quotes? The above method is sorta techie for some, and prone to error. There is another solution: use an Ajax library to pipe HTML directly to a div tag. This solution is more scalable because you can put all the HTML in a separate file, and you don’t have to escape characters.

    Download this Javascript library from Prototype JavaScript framework: Easy Ajax and DOM manipulation for dynamic web applications and copy the file somewhere in your site’s html directory (here I called it div_updater.js and put it in my js directory). Reference the file in a script tag using the ‘src’ element, then use the Ajax.Updater function to specify 1) the div id where the text should be written and 2) the file to be included.


    <div id="target_div"></div>
    <script type="text/javascript" src="js/div_updater.js"></script>
    <script type="text/javascript">
    new Ajax.Updater('target_div', 'include_file.php');
    </script>

    This solution will write the text to where-ever you have the target_div. Just make sure you use give the div an ‘id’ and that its name is referenced correctly by the Updater function. Using one of these solutions, you can utilize javascript to hide text from the search engines.
    {{ DiscussionBoard.errors[3996740].message }}
    • Profile picture of the author paulgl
      If you insist on javascript, you have to work around it, not with
      it.

      Concentrate on each page title and have an <h1> heading on each page.
      Looks like you might already have that.

      Then make a sidebar with all similar web cams and to subheadings.
      Anchor text and internal linking on each and every page is much better.

      Once the visitor clicks on get started on the home page, they should
      be given a choice, with real text links, to cams to view next. You
      can keep the random button. But to just have a random button and
      no other links is killing your internal linking. That's why pages are not
      being indexed. A sitemap for google is pretty useless for visitors.
      You want all pages to be readily gotten to with no more than 1-3
      clicks.

      I would even put a few featured cam text links on the home page.

      Nothing beats plain text and text links.

      Paul
      Signature

      If you were disappointed in your results today, lower your standards tomorrow.

      {{ DiscussionBoard.errors[3996808].message }}
      • Profile picture of the author palmer9999
        Originally Posted by paulgl View Post

        If you insist on javascript, you have to work around it, not with
        it.

        Concentrate on each page title and have an <h1> heading on each page.
        Looks like you might already have that.

        Then make a sidebar with all similar web cams and to subheadings.
        Anchor text and internal linking on each and every page is much better.

        Once the visitor clicks on get started on the home page, they should
        be given a choice, with real text links, to cams to view next. You
        can keep the random button. But to just have a random button and
        no other links is killing your internal linking. That's why pages are not
        being indexed. A sitemap for google is pretty useless for visitors.
        You want all pages to be readily gotten to with no more than 1-3
        clicks.

        I would even put a few featured cam text links on the home page.

        Nothing beats plain text and text links.

        Paul
        Thanks Paul!

        I was thinking text links, when I go into my google webmasters internal links are virtually zero.... This is a good idea, I just have to work on implementing this

        The featured cams are a great idea. Especially on the home page.
        Just means a lot more work, I suppose no one said it would be easy.
        {{ DiscussionBoard.errors[3997113].message }}
    • Profile picture of the author palmer9999
      Originally Posted by bestbuddy1986 View Post

      the easiest is using javascript's document.write:


      <script type="text/javascript">
      document.write('Hello World');
      </script>

      This works great for simple little messages, but what if you have a large multi-line text string? What if your text has HTML tags and double quotes in it? Then you're in for some trouble, because the nice little javascript examples will die on you most ingloriously. PHP to the rescue. Use PHP to replace the spaces (and double-quotes)... you may have to escape your double-quotes in the source text.

      Extending that simple little example with some meaty text and some PHP, you end up with something like this:


      <?php

      Originally Posted by bestbuddy1986 View Post

      the easiest is using javascript's document.write:


      <script type="text/javascript">
      document.write('Hello World');
      </script>

      This works great for simple little messages, but what if you have a large multi-line text string? What if your text has HTML tags and double quotes in it? Then you're in for some trouble, because the nice little javascript examples will die on you most ingloriously. PHP to the rescue. Use PHP to replace the spaces (and double-quotes)... you may have to escape your double-quotes in the source text.

      Extending that simple little example with some meaty text and some PHP, you end up with something like this:


      <?php

      $text = "
      <p>
      Hello,
      big, multi-line
      "stuff", watch out!
      </p>
      ";

      $text = preg_replace("/s+/"," ",$text);
      $text = preg_replace('/\"/',""",$text);

      ?>

      <script type="text/javascript">
      document.write('<?php echo $text; ?>');
      </script>

      That solution works (at least, it did before I had to replace all the tags with html entities to make this post). The text gets written at that point in the document once it loads on the client-side. Notice that the regular expressions replace double-quotes with 2 single quotes (tricky, eh?), and any excessive space is replaced. But what if you want something more complicated... what if you don't like the regular expressions and having to escape your double-quotes? The above method is sorta techie for some, and prone to error. There is another solution: use an Ajax library to pipe HTML directly to a div tag. This solution is more scalable because you can put all the HTML in a separate file, and you don't have to escape characters.

      Download this Javascript library from Prototype JavaScript framework: Easy Ajax and DOM manipulation for dynamic web applications and copy the file somewhere in your site's html directory (here I called it div_updater.js and put it in my js directory). Reference the file in a script tag using the 'src' element, then use the Ajax.Updater function to specify 1) the div id where the text should be written and 2) the file to be included.


      <div id="target_div"></div>
      <script type="text/javascript" src="js/div_updater.js"></script>
      <script type="text/javascript">
      new Ajax.Updater('target_div', 'include_file.php');
      </script>

      This solution will write the text to where-ever you have the target_div. Just make sure you use give the div an 'id' and that its name is referenced correctly by the Updater function. Using one of these solutions, you can utilize javascript to hide text from the search engines.
      Wow great info thanks but on the upside for the way my site is set up at the moment I believe it would be to hard to implement that. It was suggested to me before to use a bit of AJAX and just have one page which refreshes the image, but I tried this it was literally about 10x slower.

      Will keep this in mind though for a later date thanks. = "
      <p>
      Hello,
      big, multi-line
      "stuff", watch out!
      </p>
      ";

      Originally Posted by bestbuddy1986 View Post

      the easiest is using javascript's document.write:


      <script type="text/javascript">
      document.write('Hello World');
      </script>

      This works great for simple little messages, but what if you have a large multi-line text string? What if your text has HTML tags and double quotes in it? Then you're in for some trouble, because the nice little javascript examples will die on you most ingloriously. PHP to the rescue. Use PHP to replace the spaces (and double-quotes)... you may have to escape your double-quotes in the source text.

      Extending that simple little example with some meaty text and some PHP, you end up with something like this:


      <?php

      $text = "
      <p>
      Hello,
      big, multi-line
      "stuff", watch out!
      </p>
      ";

      $text = preg_replace("/s+/"," ",$text);
      $text = preg_replace('/\"/',""",$text);

      ?>

      <script type="text/javascript">
      document.write('<?php echo $text; ?>');
      </script>

      That solution works (at least, it did before I had to replace all the tags with html entities to make this post). The text gets written at that point in the document once it loads on the client-side. Notice that the regular expressions replace double-quotes with 2 single quotes (tricky, eh?), and any excessive space is replaced. But what if you want something more complicated... what if you don't like the regular expressions and having to escape your double-quotes? The above method is sorta techie for some, and prone to error. There is another solution: use an Ajax library to pipe HTML directly to a div tag. This solution is more scalable because you can put all the HTML in a separate file, and you don't have to escape characters.

      Download this Javascript library from Prototype JavaScript framework: Easy Ajax and DOM manipulation for dynamic web applications and copy the file somewhere in your site's html directory (here I called it div_updater.js and put it in my js directory). Reference the file in a script tag using the 'src' element, then use the Ajax.Updater function to specify 1) the div id where the text should be written and 2) the file to be included.


      <div id="target_div"></div>
      <script type="text/javascript" src="js/div_updater.js"></script>
      <script type="text/javascript">
      new Ajax.Updater('target_div', 'include_file.php');
      </script>

      This solution will write the text to where-ever you have the target_div. Just make sure you use give the div an 'id' and that its name is referenced correctly by the Updater function. Using one of these solutions, you can utilize javascript to hide text from the search engines.
      Wow great info thanks but on the upside for the way my site is set up at the moment I believe it would be to hard to implement that. It was suggested to me before to use a bit of AJAX and just have one page which refreshes the image, but I tried this it was literally about 10x slower.

      Will keep this in mind though for a later date thanks. = preg_replace("/s+/"," ",
      Originally Posted by bestbuddy1986 View Post

      the easiest is using javascript's document.write:


      <script type="text/javascript">
      document.write('Hello World');
      </script>

      This works great for simple little messages, but what if you have a large multi-line text string? What if your text has HTML tags and double quotes in it? Then you're in for some trouble, because the nice little javascript examples will die on you most ingloriously. PHP to the rescue. Use PHP to replace the spaces (and double-quotes)... you may have to escape your double-quotes in the source text.

      Extending that simple little example with some meaty text and some PHP, you end up with something like this:


      <?php

      $text = "
      <p>
      Hello,
      big, multi-line
      "stuff", watch out!
      </p>
      ";

      $text = preg_replace("/s+/"," ",$text);
      $text = preg_replace('/\"/',""",$text);

      ?>

      <script type="text/javascript">
      document.write('<?php echo $text; ?>');
      </script>

      That solution works (at least, it did before I had to replace all the tags with html entities to make this post). The text gets written at that point in the document once it loads on the client-side. Notice that the regular expressions replace double-quotes with 2 single quotes (tricky, eh?), and any excessive space is replaced. But what if you want something more complicated... what if you don't like the regular expressions and having to escape your double-quotes? The above method is sorta techie for some, and prone to error. There is another solution: use an Ajax library to pipe HTML directly to a div tag. This solution is more scalable because you can put all the HTML in a separate file, and you don't have to escape characters.

      Download this Javascript library from Prototype JavaScript framework: Easy Ajax and DOM manipulation for dynamic web applications and copy the file somewhere in your site's html directory (here I called it div_updater.js and put it in my js directory). Reference the file in a script tag using the 'src' element, then use the Ajax.Updater function to specify 1) the div id where the text should be written and 2) the file to be included.


      <div id="target_div"></div>
      <script type="text/javascript" src="js/div_updater.js"></script>
      <script type="text/javascript">
      new Ajax.Updater('target_div', 'include_file.php');
      </script>

      This solution will write the text to where-ever you have the target_div. Just make sure you use give the div an 'id' and that its name is referenced correctly by the Updater function. Using one of these solutions, you can utilize javascript to hide text from the search engines.
      Wow great info thanks but on the upside for the way my site is set up at the moment I believe it would be to hard to implement that. It was suggested to me before to use a bit of AJAX and just have one page which refreshes the image, but I tried this it was literally about 10x slower.

      Will keep this in mind though for a later date thanks.);
      Originally Posted by bestbuddy1986 View Post

      the easiest is using javascript's document.write:


      <script type="text/javascript">
      document.write('Hello World');
      </script>

      This works great for simple little messages, but what if you have a large multi-line text string? What if your text has HTML tags and double quotes in it? Then you're in for some trouble, because the nice little javascript examples will die on you most ingloriously. PHP to the rescue. Use PHP to replace the spaces (and double-quotes)... you may have to escape your double-quotes in the source text.

      Extending that simple little example with some meaty text and some PHP, you end up with something like this:


      <?php

      $text = "
      <p>
      Hello,
      big, multi-line
      "stuff", watch out!
      </p>
      ";

      $text = preg_replace("/s+/"," ",$text);
      $text = preg_replace('/\"/',""",$text);

      ?>

      <script type="text/javascript">
      document.write('<?php echo $text; ?>');
      </script>

      That solution works (at least, it did before I had to replace all the tags with html entities to make this post). The text gets written at that point in the document once it loads on the client-side. Notice that the regular expressions replace double-quotes with 2 single quotes (tricky, eh?), and any excessive space is replaced. But what if you want something more complicated... what if you don't like the regular expressions and having to escape your double-quotes? The above method is sorta techie for some, and prone to error. There is another solution: use an Ajax library to pipe HTML directly to a div tag. This solution is more scalable because you can put all the HTML in a separate file, and you don't have to escape characters.

      Download this Javascript library from Prototype JavaScript framework: Easy Ajax and DOM manipulation for dynamic web applications and copy the file somewhere in your site's html directory (here I called it div_updater.js and put it in my js directory). Reference the file in a script tag using the 'src' element, then use the Ajax.Updater function to specify 1) the div id where the text should be written and 2) the file to be included.


      <div id="target_div"></div>
      <script type="text/javascript" src="js/div_updater.js"></script>
      <script type="text/javascript">
      new Ajax.Updater('target_div', 'include_file.php');
      </script>

      This solution will write the text to where-ever you have the target_div. Just make sure you use give the div an 'id' and that its name is referenced correctly by the Updater function. Using one of these solutions, you can utilize javascript to hide text from the search engines.
      Wow great info thanks but on the upside for the way my site is set up at the moment I believe it would be to hard to implement that. It was suggested to me before to use a bit of AJAX and just have one page which refreshes the image, but I tried this it was literally about 10x slower.

      Will keep this in mind though for a later date thanks. = preg_replace('/\"/',""",
      Originally Posted by bestbuddy1986 View Post

      the easiest is using javascript's document.write:


      <script type="text/javascript">
      document.write('Hello World');
      </script>

      This works great for simple little messages, but what if you have a large multi-line text string? What if your text has HTML tags and double quotes in it? Then you're in for some trouble, because the nice little javascript examples will die on you most ingloriously. PHP to the rescue. Use PHP to replace the spaces (and double-quotes)... you may have to escape your double-quotes in the source text.

      Extending that simple little example with some meaty text and some PHP, you end up with something like this:


      <?php

      $text = "
      <p>
      Hello,
      big, multi-line
      "stuff", watch out!
      </p>
      ";

      $text = preg_replace("/s+/"," ",$text);
      $text = preg_replace('/\"/',""",$text);

      ?>

      <script type="text/javascript">
      document.write('<?php echo $text; ?>');
      </script>

      That solution works (at least, it did before I had to replace all the tags with html entities to make this post). The text gets written at that point in the document once it loads on the client-side. Notice that the regular expressions replace double-quotes with 2 single quotes (tricky, eh?), and any excessive space is replaced. But what if you want something more complicated... what if you don't like the regular expressions and having to escape your double-quotes? The above method is sorta techie for some, and prone to error. There is another solution: use an Ajax library to pipe HTML directly to a div tag. This solution is more scalable because you can put all the HTML in a separate file, and you don't have to escape characters.

      Download this Javascript library from Prototype JavaScript framework: Easy Ajax and DOM manipulation for dynamic web applications and copy the file somewhere in your site's html directory (here I called it div_updater.js and put it in my js directory). Reference the file in a script tag using the 'src' element, then use the Ajax.Updater function to specify 1) the div id where the text should be written and 2) the file to be included.


      <div id="target_div"></div>
      <script type="text/javascript" src="js/div_updater.js"></script>
      <script type="text/javascript">
      new Ajax.Updater('target_div', 'include_file.php');
      </script>

      This solution will write the text to where-ever you have the target_div. Just make sure you use give the div an 'id' and that its name is referenced correctly by the Updater function. Using one of these solutions, you can utilize javascript to hide text from the search engines.
      Wow great info thanks but on the upside for the way my site is set up at the moment I believe it would be to hard to implement that. It was suggested to me before to use a bit of AJAX and just have one page which refreshes the image, but I tried this it was literally about 10x slower.

      Will keep this in mind though for a later date thanks.);

      ?>

      <script type="text/javascript">
      document.write('<?php echo
      Originally Posted by bestbuddy1986 View Post

      the easiest is using javascript's document.write:


      <script type="text/javascript">
      document.write('Hello World');
      </script>

      This works great for simple little messages, but what if you have a large multi-line text string? What if your text has HTML tags and double quotes in it? Then you're in for some trouble, because the nice little javascript examples will die on you most ingloriously. PHP to the rescue. Use PHP to replace the spaces (and double-quotes)... you may have to escape your double-quotes in the source text.

      Extending that simple little example with some meaty text and some PHP, you end up with something like this:


      <?php

      $text = "
      <p>
      Hello,
      big, multi-line
      "stuff", watch out!
      </p>
      ";

      $text = preg_replace("/s+/"," ",$text);
      $text = preg_replace('/\"/',""",$text);

      ?>

      <script type="text/javascript">
      document.write('<?php echo $text; ?>');
      </script>

      That solution works (at least, it did before I had to replace all the tags with html entities to make this post). The text gets written at that point in the document once it loads on the client-side. Notice that the regular expressions replace double-quotes with 2 single quotes (tricky, eh?), and any excessive space is replaced. But what if you want something more complicated... what if you don't like the regular expressions and having to escape your double-quotes? The above method is sorta techie for some, and prone to error. There is another solution: use an Ajax library to pipe HTML directly to a div tag. This solution is more scalable because you can put all the HTML in a separate file, and you don't have to escape characters.

      Download this Javascript library from Prototype JavaScript framework: Easy Ajax and DOM manipulation for dynamic web applications and copy the file somewhere in your site's html directory (here I called it div_updater.js and put it in my js directory). Reference the file in a script tag using the 'src' element, then use the Ajax.Updater function to specify 1) the div id where the text should be written and 2) the file to be included.


      <div id="target_div"></div>
      <script type="text/javascript" src="js/div_updater.js"></script>
      <script type="text/javascript">
      new Ajax.Updater('target_div', 'include_file.php');
      </script>

      This solution will write the text to where-ever you have the target_div. Just make sure you use give the div an 'id' and that its name is referenced correctly by the Updater function. Using one of these solutions, you can utilize javascript to hide text from the search engines.
      Wow great info thanks but on the upside for the way my site is set up at the moment I believe it would be to hard to implement that. It was suggested to me before to use a bit of AJAX and just have one page which refreshes the image, but I tried this it was literally about 10x slower.

      Will keep this in mind though for a later date thanks.; ?>');
      </script>

      That solution works (at least, it did before I had to replace all the tags with html entities to make this post). The text gets written at that point in the document once it loads on the client-side. Notice that the regular expressions replace double-quotes with 2 single quotes (tricky, eh?), and any excessive space is replaced. But what if you want something more complicated... what if you don't like the regular expressions and having to escape your double-quotes? The above method is sorta techie for some, and prone to error. There is another solution: use an Ajax library to pipe HTML directly to a div tag. This solution is more scalable because you can put all the HTML in a separate file, and you don't have to escape characters.

      Download this Javascript library from Prototype JavaScript framework: Easy Ajax and DOM manipulation for dynamic web applications and copy the file somewhere in your site's html directory (here I called it div_updater.js and put it in my js directory). Reference the file in a script tag using the 'src' element, then use the Ajax.Updater function to specify 1) the div id where the text should be written and 2) the file to be included.


      <div id="target_div"></div>
      <script type="text/javascript" src="js/div_updater.js"></script>
      <script type="text/javascript">
      new Ajax.Updater('target_div', 'include_file.php');
      </script>

      This solution will write the text to where-ever you have the target_div. Just make sure you use give the div an 'id' and that its name is referenced correctly by the Updater function. Using one of these solutions, you can utilize javascript to hide text from the search engines.
      Wow great info thanks but on the upside for the way my site is set up at the moment I believe it would be to hard to implement that. It was suggested to me before to use a bit of AJAX and just have one page which refreshes the image, but I tried this it was literally about 10x slower.

      Will keep this in mind though for a later date thanks.
      {{ DiscussionBoard.errors[3997187].message }}

Trending Topics