Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jul 22nd, 2006, 2:20 AM   #1
Writlaus
Hobbyist Programmer
 
Writlaus's Avatar
 
Join Date: Nov 2005
Posts: 149
Rep Power: 3 Writlaus is on a distinguished road
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?
Writlaus is offline   Reply With Quote
Old Jul 22nd, 2006, 5:44 AM   #2
Arevos
Programming Guru
 
Arevos's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5 Arevos is on a distinguished road
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?
Arevos is offline   Reply With Quote
Old Jul 22nd, 2006, 6:58 AM   #3
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
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
DaWei is offline   Reply With Quote
Old Jul 22nd, 2006, 8:43 AM   #4
Writlaus
Hobbyist Programmer
 
Writlaus's Avatar
 
Join Date: Nov 2005
Posts: 149
Rep Power: 3 Writlaus is on a distinguished road
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.
Writlaus is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
C# corruption!!! Kilo C++ 32 May 21st, 2006 9:44 PM
Need help writing a member function Rawr101 C++ 3 Apr 11th, 2006 4:18 AM
Exporting Functions victorsk Visual Basic 1 May 18th, 2005 3:32 PM
User-defined creatNode and deleteNode functions for a doubly-linked list jgs C 2 Apr 28th, 2005 9:53 AM
Executing from JavaScript C# functions see07 C# 0 Feb 14th, 2005 2:08 PM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 7:38 AM.

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