I have a empty html file that call to a js file. Inside that file I have this coded.
if (typeof web3 !== 'undefined') {
web3 = new Web3(web3.currentProvider);
} else {
// set the provider you want from Web3.providers
web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:22000"));
}
web3.eth.getBlock(18, function(error, result){
if(!error)
console.log(JSON.stringify(result));
else
console.error(error);
});
But when I execute i get this error:
missing CORS header 'Access-Control-Allow-Origin
Any idea to solve this issue??
--jsonrpc-cors=all
if it's Parity.