Forum Moderators: phranque

Message Too Old, No Replies

Spider-Friendly Select Form Question?

SE's not finding/spidering my new pages...

         

CalArch90

2:14 am on May 8, 2005 (gmt 0)

10+ Year Member



I've created a select box with some javascript embedded that links to various pages on my site. It seems the search engine spiders/bots are not able to follow the links (probably because of the javascript in the code).

Does anyone know a way around this. The nice thing about this script is it doesn't require the user to have to press a submit button, but automatically directs the user to the desired page. Here is the script format:

<FORM name="guideform">
<SELECT name="guidelinks" onChange="window.location=document.guideform.guidelinks.options[document.guideform.guidelinks.selectedIndex].value">
<OPTION SELECTED>--Select Option--
<OPTION value="/page1.html">Page1
<OPTION value="/page2.html">Page2
<OPTION value="/page3.html">Page3
</SELECT>
</FORM>

I like the way the script works, but need to have my site pages spidered, so I will likely need a new format. Does anyone have any suggestions as to what to do?

TheDoctor

7:49 am on May 8, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What should a visitor who doesn't have javascript enabled do? You need to have NOSCRIPT markup every time you use javascript.

Since a spider is, amaongst other things, a visitor who doesn't have javascript enabled, then answering the NOSCRIPT question will solve your problem.

CalArch90

11:00 am on May 8, 2005 (gmt 0)

10+ Year Member



Thanks for the feedback. I'll try that out and see if it works.

CalArch90

12:44 pm on May 8, 2005 (gmt 0)

10+ Year Member



As a followup, would it be enough to add the following:

<NOSCRIPT><INPUT type="submit" value="Go" name="guideform"></NOSCRIPT>

This would allow users to execute the drop down menu if they don't have javascript enabled, but would the SE spiders/bots be able to then follow the links, or do I need to include anchor text links in the noscript?

girish

8:31 pm on May 8, 2005 (gmt 0)

10+ Year Member



simply nest link tags within the option tags. it is not valid code, but i've tested it extensively and it never breaks. so it would be like so..

<form name="guideform">
<select name="guidelinks" onChange="window.location=document.guideform.guidelinks.options[document.guideform.guidelinks.selectedIndex].value">
<option selected>--Select Option--</option>
<option value="/page1.html"><a href="/page1.html">Page1</a></option>
<option value="/page2.html"><a href="/page2.html">Page2</a></option>
<option value="/page3.html"><a href="/page2.html">Page3</a></option>
</select>
</form>

CalArch90

2:22 am on May 9, 2005 (gmt 0)

10+ Year Member



Thanks girish. That's an interesting way of doing it. That should work for what I need.