GooglePages: Now with JavaScript!
The time has come—JavaScript can now be added to GooglePages! JavaScript is perhaps the most anxiously awaited addition to GooglePages, because the ability to add JS content allows a webmaster to use a multitude of third-party scripts and applications.
Hit counters
and other tools for measuring the site usage statistics are one example of such popular third-party applications. Visual effects can be added to a GooglePage using simple JS
or a JS-based mini-browser
. And adding AdSense
is a must-have option for those interested in making money.
Manually Uploaded "GooglePages"
The simplest way around the original restriction against using JavaScript in pages built using Google Page Creator is not to use GPC at all, but rather to build pages using one's software of choice and upload the HTML files to the GooglePages account.
This method works for adding pretty much any kind of content, except that the default home page of a GooglePages site can not be created, edited, or replaced in this manner. And the home page, of course, is very important for applications such as web counters
. Also, having a mix of uploaded and GPC-built pages can pose some challenges in terms of maintaining a uniform site design.
Adding JavaScript to GooglePages
A simple procedure for adding JS to a GooglePage.
- find a suitable piece of JavaScript code
- in Google Page Creator, select an editable field
- select "Edit HTML" option
- paste the JavaScript code into the source HTML
- add <DIV></DIV> wrapper around the script
- "Save Changes" and see if it worked!
The basic reason why this simple approach works is that GPC no longer removes or disables JavaScript. The tutorials in this section of GPX-Files provide examples of useful JavaScript tools that work on GooglePages, and a list of important known bugs
and suggested work-arounds. These JS bugs are primarily generated because GPC is an AJAX application and therefore it can execute JS code.
Warnings
The following common-sense minimal precautions are strongly recommended when working with JS on GooglePages:
- practice on test pages first
-
make an external backup copy of HTML code, e.g., in a text editor
, for every editable field on every GooglePage [such a backup will make recovering corrupted pages a snap]
- become familiar with the process and its important caveats before attempting to add JS code to the default "home" page of a GooglePages site [the default "home" page is the only GooglePage that cannot be deleted and re-created in GPC]
The detailed List of Known Bugs
is a must-read before attempting any serious experimentation with JS on GooglePages.
Good Luck and Have Fun!
The above somber warnings are meant to emphasize that bugs will be encountered and pages will become corrupted at first. But this site itself is a testament to the fact that a wide variety of JS scripts and third-party tools can be successfully added to GooglePages. In fact, with proper precautions, the process of exploring the possibilities can be quite interesting and rewarding.




JavaScript