Yes. Using JavaScript, the only way I can think of is to write an implementation of Bressenham's line drawing algorithm.
There are a few JS graphic libraries out there which do this already, and I've written one, but don't have the source available right now.
I suuggest searching on Google for "javascript graphics library"... It should turn up at least one of the JS libraries out there.
Hope this helps,
Dan