Skip to content
Advertisement

Tag: urlencode

react-cropper URL insanely long

I’m trying to save cropped images using react-cropper. It seems to work as intended, but the URL that gets saved is crazy long. The console log of the data package alone is often over 100kb, and that’s just a data URL. When I console log (and send to a DB) I store a value that starts with data:image/png;base64,iVBORw0… and then

How to create query parameters in Javascript?

Is there any way to create the query parameters for doing a GET request in JavaScript? Just like in Python you have urllib.urlencode(), which takes in a dictionary (or list of two tuples) and creates a string like ‘var1=value1&var2=value2’. Answer Here you go: Usage:

Advertisement