Question

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.

Était-ce utile?

La solution

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

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top