Javascript + del.icio.us connection problem...
July 11, 2005 6:28 AM   RSS feed for this thread Subscribe

How do I properly establish a del.icio.us connection via Javascript?

I'm having a bit of trouble implementing the Javascript del.icio.us library and was hoping someone out there has used it before and could let me know what I'm doing wrong.

My code is as follows:

var deliciousConnection = new Delicious({username:deliciousAccountForm.deliciousUsername.value, password:deliciousAccountForm.deliciousPassword.value});

If I do an:

alert(deliciousConnection.last_error().toString());

...I get an undefined: Null value system error. Beyond this point I can't do anything with the connection as it is undefined.

I'm implementing the constructor as directed, and I looked at the root delicious.js file to double-check the implementation. I'm reasonably certain I'm importing the two required javascript scripts properly into my HTML file.

Nonetheless, anyone familiar with this API know what I'm doing wrong?
posted by Rothko to computers & internet (1 comment total)
can't help you with specifics, but in general for javascript debugging:
- chase back up the dotted list, to make sure you're certain where the null value is (is deliciousConnection itself null, for example?)
- different platforms give different levels of detail in error messages. try a few.
- rather than use alert, try throwing a value as an error. you may see more detail, especially if it's an error you're throwing (raising? can't remember the syntax).

these may be obvious/wrong - i don't have a lot of javascript experience, but they've helped me solve things like this in the past.
posted by andrew cooke at 11:34 AM on July 11, 2005


« Older Why does our new cat lick the ...   |   I am looking for a higher reso... Newer »

You are not logged in, either login or create an account to post comments



Related Questions
stop scrolling, damn ye! May 2, 2007
Mark CF, if you're reading this, shoo! January 23, 2007
I'll trade you a proxy for a doxy! (Er, or not.) March 12, 2006
JavaScript only RSS parser? June 17, 2005
DHTML-ish function question... April 13, 2005