Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   JavaScript and Client-Side Browser Scripting (http://www.programmingforums.org/forum23.html)
-   -   Writing Javascript functions for a Google Gadget? (http://www.programmingforums.org/showthread.php?t=10799)

Writlaus Jul 22nd, 2006 1:20 AM

Writing Javascript functions for a Google Gadget?
 
Here's my problem.

I'm trying to get an xml file with javascript to work as a "gadget" on my Google Personalized page. However, I can't use the tags <html>, <body>, or <head>, so I'm not sure how I'm going to write functions. Google's developer guide said to just strip away those tags and put the html with the javascript in the html section of the xml file, but my functions don't work then (not surprising, as I don't have a <head> section). The Javascript works fine other than that.

My question is this: Is there any way to define functions outside of the <head> tag? Can anyone think of another way around this problem?

Arevos Jul 22nd, 2006 4:44 AM

If I recall correctly, script tags can be placed in any part of a HTML document. Perhaps you should look at the source of other gadgets to see how they operate?

DaWei Jul 22nd, 2006 5:58 AM

Javascript doesn't have to be in the head.

Writlaus Jul 22nd, 2006 7:43 AM

I have it figured out now. The tutorial I'd read said that functions "are placed in the head". I thought it meant it had to be, so when it didn't work elsewhere, I asssumed that was the problem. Turns out that the problem was just in my code, though.


All times are GMT -5. The time now is 1:44 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC