|
Text to JavaScript Converter
by Will Bontrager
Copyright 2009 Bontrager Connection, LLC
Several articles in the Willmaster library talk about how to convert text into JavaScript.
This article provides a one-page text to JavaScript converter. The conversion is done with PHP. The converted JavaScript is for saving to an external file. The code for importing the file is also generated.
Upload the text to JavaScript converter on your web site where it's handy for whenever you need it.
The content published with JavaScript may be a word, a phrase, a paragraph, or more.
Reasons For Using JavaScript
There are a few reasons to use JavaScript for publishing certain content on web pages:
A. Hiding content from robots and spiders.
JavaScript content generally is not seen by robots and may not get indexed by search engine spiders, especially when the JavaScript is imported from an external file.
-
Certain words or phrases in the content, if indexed, may have a detrimental affect on the web page's search results position.
-
Certain words or phrases in the content may cause search engine algorithms to mark the web page as a bad neighborhood.
-
If the content is an ad or something else with views counted, the logs will better represent actual views.
B. Publishing certain content only for browsers with JavaScript enabled.
Here are a few reasons for publishing certain content only if the browser has JavaScript turned on.
-
To publish links to games or other content that can work only with JavaScript.
-
To hide forms from spammers' automatic submission robots.
-
To publish content only when the page is loaded in a certain browser. (Code to check for type of browser can be obtained from Right-Click and 'Select ________' and modified to suit.)
C. To defeat source code page copying thieves.
When the entire web page source code is copied for use somewhere else, the JavaScript to import an external file is also copied.
The .htaccess file can be used to take control if the web page source code is published on another domain.
The Defeating Source Code Page Copying Thieves blog post tells you how.
The Text to JavaScript Conversion Software
Here is the complete PHP web page to convert text to JavaScript.
The above needs no customization.
Save it as any web page file name ending with .php and upload it to your server. You're then good to go (provided your server is set up to run PHP).
To use the software, type the PHP web page's URL into your browser.
Example Installation
Here is an example of the above text to JavaScript PHP web page in action: Text to JavaScript Converter
Perhaps some of the reasons to publish content with JavaScript given in this article are reasons that affect your web site.
If yes, use the above example installation or install the JavaScript converter on your server to convert the relevant text into JavaScript.
Will Bontrager
Click Here to share this weekly article with your online friends.
Was this article interesting?
Does it provide information you can use?
How can it be improved?
Your comment is anonymous.
When done, click anywhere outside the box.
Powered by Master Syndicator and provided by
WillMaster Possibilities
|