In a web app, I'm sending content of a XML file as part of the URL parameter (not the best design probably but for now I'm stuck with it). So the address looks like this:
http://localhost:5000/fill?xml=XXXXXXXXXXXXX
which is generated with url_for('url', xml=xml)
from Flask.
And I'm doing this on the client side:
var img = document.getElementById('preview');
var xmlstr = decodeURIComponent(GetURLParameter("xml"));
var xml = $.parseXML(xmlstr);
Naturally the content of the XML file will get encoded. But all the spaces in the file is transformed into plus signs +
. And when I use $.parseXML()
function to decode it, the +
is still there.
Why?