user9110: I am a web developer and looking for well written technical documents about how bitcoin/litecoin works, what is the workflow, what is the algorithm and how can I write a miner from scratch by using JavaScript (or similar).
It will be a kind of hobby/portfolio project, so I am not worrying about the performance and the other possible issues.
Thanks in advance.

user3724: This isn't written specifically about mining, but I wrote a comprehensive document that a web developer can follow. It also contains the library on the page so you can experiment along in the console. 
Here it is:
Generating a Bitcoin Address in JavaScript
Hopefully it helps you some on your quest to learn more about Bitcoin.

user-1: Why reinvent the wheel?
I think there are several simple javascript miners out there, so I won't bother telling you more than to google it (or to duckduckgo it, if you prefer).
But whilst we are at it: Would you believe people have gone far beyond it and found a way to program a javascript-based miner using GPUs, as pointed out in an answer on bitcoin.stackexchange? That project is hosted here.

9110: <p>I am a web developer and looking for well written technical documents about how bitcoin/litecoin works, what is the workflow, what is the algorithm and how can I write a miner from scratch by using JavaScript (or similar).</p>

<p>It will be a kind of hobby/portfolio project, so I am not worrying about the performance and the other possible issues.</p>

<p>Thanks in advance.</p>
 3724: <p>This isn't written specifically about mining, but I wrote a comprehensive document that a web developer can follow. It also contains the library on the page so you can experiment along in the console. </p>

<p>Here it is:</p>

<p><a href="http://procbits.com/2013/08/27/generating-a-bitcoin-address-with-javascript" rel="nofollow">Generating a Bitcoin Address in JavaScript</a></p>

<p>Hopefully it helps you some on your quest to learn more about Bitcoin.</p>
 -1: <p>Why reinvent the wheel?</p>

<p>I think there are several simple javascript miners out there, so I won't bother telling you more than to google it (or to duckduckgo it, if you prefer).</p>

<p>But whilst we are at it: Would you believe people have gone far beyond it and found a way to program a javascript-based miner using GPUs, as pointed out in <a href="https://bitcoin.stackexchange.com/questions/10320/how-useful-is-a-javascript-miner/10327#10327">an answer on bitcoin.stackexchange</a>? That project is <a href="https://code.google.com/p/hamiyoca/" rel="nofollow noreferrer">hosted here</a>.</p>
