![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Hobbyist Programmer
Join Date: Nov 2005
Posts: 149
Rep Power: 3
![]() |
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? |
|
|
|
|
|
#2 |
|
Programming Guru
![]() Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 4
![]() |
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?
|
|
|
|
|
|
#3 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
Javascript doesn't have to be in the head.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#4 |
|
Hobbyist Programmer
Join Date: Nov 2005
Posts: 149
Rep Power: 3
![]() |
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.
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| C# corruption!!! | Kilo | C++ | 32 | May 21st, 2006 8:44 PM |
| Need help writing a member function | Rawr101 | C++ | 3 | Apr 11th, 2006 3:18 AM |
| Exporting Functions | victorsk | Visual Basic | 1 | May 18th, 2005 2:32 PM |
| User-defined creatNode and deleteNode functions for a doubly-linked list | jgs | C | 2 | Apr 28th, 2005 8:53 AM |
| Executing from JavaScript C# functions | see07 | C# | 0 | Feb 14th, 2005 1:08 PM |