Is it possible to use a DataURI instead of a URL in an XmlHttpRequest (AJAX) call so it's not really going over the wire rather using data that's already in the client? I'm going to experiment with it, but I wanted to see if anyone has done something like that or if it's even possible. Thanks!

Context: My use case is to work around a problem I'm facing in OpenLayers where they expect a URL, but I have the data on the client already and want to load it directly since it's a large file.

有帮助吗?

解决方案

The answer here is that you cannot use DataURI with XmlHttpRequest. As pointed by @dandavis above, it is a different protocol.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top