Javascript + del.icio.us connection problem...
July 11, 2005 6:28 AM
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)
- 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