Forum Moderators: open

Message Too Old, No Replies

Turning Select Box into Javascript

Need help....

         

wfernley

4:52 pm on May 31, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hey everyone,

I currently have a select box on every page of my site that contains about 20 options. I dont want these options to be seen by Search Engines because if someone types in a keyword that is in that select box, anyone of my pages come up and I don't want them too. Get what I'm sayin? ;)

I was curious how I can make that select box a javascript so it is not viewable by Search Engines. Would it be as easy as making an include of a *.js file? Can google read .js files?

Does anyone have any suggestions for me?

thanks in advance for your help!

Wes

RonPK

9:11 pm on May 31, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



AFAIK Google doesn't read .js-files, let alone index the contents.

wfernley

12:53 pm on Jun 1, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thats good to hear.

Considering I don't know much about Javascript. How would I go about making a select back inside a JS file?

RonPK

4:15 pm on Jun 1, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Basically, you need a script that contains statements to write the select box. Include it at the right place, and it should work...

The script in the .js file:

document.writeln('<select name="myselect">');
document.writeln('<option value="1">Jack</option>');
document.writeln('<option value="2">Jill</option>');
document.writeln('</select>');

Include it by inserting this into your web page:

<script type="text/javascript" src="nameoffile.js"></script>