Mist recently launched its Beta (0.8.0), you can call any website for getting the HTML and JS files. What happens if inside my Dapp I make a XMLHttpRequest?
2 Answers
A DApp's "frontend" is typically HTML and JS, so they can make ajax requests and do anything that web apps can. (The decentralized part of a DApp mainly refers to its "backend", which typically needs to be deterministic for decentralized consensus.)
-
What I find curious about this is that if you can make ajax requests, your Dapp can effectively have two backends: One through a standard web JSON API, and another one that uses Web3. Jul 11, 2016 at 6:15
-
Yes it can! Use the blockchain/Web3 for the parts that have to be trustless/honest; use a normal web server for things like heavy computation that should not be done by the blockchain. Even doing things like string manipulation, is usually better done in Javascript instead of Solidity.– eth ♦Jul 11, 2016 at 6:45
In addition to what eth was saying, and for others coming here through google: I had the same struggles in the beginning. I didn't really know where to start. What helped a lot was reading through the solidity docs, there are some good examples in the beginning of what is possible with Solidity and what not.
As a starter: https://solidity.readthedocs.io/en/latest/
I also did write some tutorials, especially for the HTML/JS Part that access the blockchain, for example: http://www.newscombinator.com/article/8/link-list-on-the-ethereum-blockchain-with-votes
Also, read through the links provided in the "get started" post on /r/ethereum. The community is great, questions are answered quickly.