since I am hearing that web surfers are having .js disabled more and more. is there a php script to write some lines of html..? basically, I have a webpage with an external js.. this js writes about 10 lines of html,( header, image and css menu link for SEO purposes.. how can that be done with php..? I am a novice in php, so the full code & would be appreciated.
Search engines don't read JS so you can't have content in a JS file. Whats the url so I can see what the JS file is doing?
Does the js write something based on some parameters or it writes the same thing in every case? Maybe yo do not need js or php at all.
There is NO content in the external js... it is only the header and horizontal css nav menu that is being written. so, I don't need that for SEO.. I only want php to wirte this same html since people sometimes have js turned off. I basically took out 20+ lines of code and want the spiders to see the meat, content a lot quicker. anyway, here it is below: ________________________ document.write('<div class="nav1-container">' +'<div class="nav1">' +'<ul>' +'<li><a href="index.htm"><img border="0" src="img/home_wht.jpg" alt="Back to Home Page" width="48" height="20"></a></li>' +'<li><a href="contact.htm"><img border="0" src="img/contact_wht.jpg" alt="Contact Us" width="76" height="20"></a></li>' +'<li><a href="form.htm"><img border="0" src="img/blue.jpg" alt="" width="52" height="37"></a></li>' +'</ul>' +'</div>' +'</div>' +'<div class="site-name">' +'<p class="title"><a href="index.htm">okeydokey.net</a></p>' +'<p class="subtitle"><a href="index.htm">Prove Me Wrong</a></p>' +'</div>' +'<div class="site-slogan-container">' +'<div class="site-slogan">' +'<p class="title"></p>' +'<p class="subtitle"></p>' +'<p class="text">100\'s of Answers</p><br><br><br />' +'<p class="text">››› <a href="form.htm">Find a Solution Now</a></p>' +'</div>' +'</div>' +'<div><img class="img-header" src="images/headers/people.jpg" width="770" height="150" border="0"></div>' +'<div class="nav2">' +'<ul>' +'<li><a href="program.htm">Program</a></li>' +'<li><a href="home.htm">Home</a></li>' +'<li><a href="answers.htm">Answers</a></li>' +'<li><a href="questions.htm">Questions</a></li>' +'</ul>' +'</div> _________________________
Relax, having those tags in html won't hurt your rankings. Place them directly in your html and forget about js. And with php you couldn't achieve the thing you are doing with js because php is a server-side language meaning that once the code is parsed and gets sent to the visitor/web crawler you cannot alter it.
Yes, definitely use the <noscript> tag for a javascript alternative. Putting SE's aside, there are users that disable javascript, and your site can be completely broken if you rely on javascript without any alternative.