First, please make sure you are using the RPC port and not the peer-to-peer port when configuring the web demo. Second, if the node and web server are running on the same computer, you should use 127.0.0.1 (loop back) as the node's IP address, rather than its external-facing IP address. In the latter case you would need to set rpcallowip in the node's runtime parameters to accept API requests from the IP address of your web server.