24 Aug
Posted by ProCOM
on August 24, 2007 – 9:06 pm - 381 views
If you're new here, you may want to subscribe to my RSS feed. So that you can read the latest updates about Web2.0 tools, Making Money Online, Tips in SEO, Ajax and many more. Thanks for visiting ProgramimiCOM!
I will state here 3 good reasons to publish content with JavaScript;
Any HTML content can be generated for delivery with JavaScript. Most JavaScript itself can be delivered that way, should there be reason to do so.
However, don’t generate PHP code or SSI tags into JavaScript. Those have to be available at the server before the page is sent to the browser where JavaScript can run.
1. Hiding Your Forms from Spammers’ Robots.
Spammers won’t spam through your forms if they can’t be found.
The search for vulnerable forms is mostly automated.
Robots follow links until they find a form. The detecting robot then submits the form using preprogrammed methods and with preprogrammed information. If the form has a security hole of the kind the robot is scouting for, the information is recorded for the robot owner’s later perusal.
Manually surfing to find forms and testing them would be uncommon. Spammers seem to be lazy.
Here are the steps to replace the form with JavaScript:
It may be prudent to put a notice on the web page that will be seen only by those whose browsers are JavaScript disabled. Example:
<noscript> <h3>JavaScript is required to use this form.</h3> </noscript>
Now you have some protection. It’s not guaranteed to be forever effective, of course.
If you are already being spammed through your form, you’ll need to take a few steps before encoding your form with JavaScript:
Now you can replace the form with JavaScript by following the steps presented earlier.
The extra step is necessary because your form handling software’s URL is already in the spammer’s database, which means they can bypass the form. Changing the software’s file name introduces an error into their database.
For extra protection, in case robots that can read JavaScript come your way, the JavaScript-ized form can be retrieved from an external file.
2. Publishing Content Pulled from Remote Files.
When certain content is to be repeated on several pages or on several domains, the content is easier to maintain when it exists in only one file.
That content can be generated as JavaScript using a JavaScript generator. Remove the first and last lines from the generated JavaScript (the SCRIPT and cancel /SCRIPT tags) and save the rest as a file on your server.
Convention says the file is to be saved with a .js file name extension. However, .txt or .htm will do the job as well.
Once the file is saved, determine its URL.
Now, all you have to do is put the following JavaScript, with correct URL, into your web pages wherever you want the content to be printed.
<script src="http://example.com/file.js" type="text/javascript" language="JavaScript"> </script>
Replace URL http://example.com/file.js with the URL of your content file and you’re good to go.
3. Hiding Certain Content from Search Engine Spiders.
The following assumes search engine spiders do not read and parse JavaScript. If they do understand JavaScript, now or in the future, other methods can be used to do the hiding.
Certain things are oftentimes best left out of search engine indexes. Examples are advertisements and navigation areas. Their inclusion might contaminate the indexes and even skew your keyword density.
To make ads or other sections of a web page invisible to spiders:
Certain words or phrases, or entire paragraphs, can be hidden from spiders the same way.
An example of why one might want to hide a word, a product name in this case, could be an article reviewing the product. The article has an affiliate link to the product. The page also has AdSense. The name of the product in the article could attract AdSense ads for the product. And that could reduce affiliate income from that page.
There are, of course, other reasons to publish content with JavaScript. Sometimes JavaScript is the only method available. Other times, like the reasons presented here, publishing content with JavaScript is optional.
Whether or not it is optional, a JavaScript generator can help by turning text into JavaScript that will print on a web page.
Print This Post
Email This Post
Comments RSS
TrackBack Identifier URI
You must be logged in to post a comment.