Open pendave opened 8 years ago
No, not implemented yet. You can always define them though:
import js2py
context = js2py.EvalJs()
context.execute("""escape = function(text){pyimport urllib; return urllib.quote(text)};
unescape = function(text){pyimport urllib; return urllib.unquote(text)};
encodeURI = function(text){pyimport urllib; return urllib.quote(text, safe='~@#$&()*!+=:;,.?/\\'')};
decodeURI = unescape;
encodeURIComponent = function(text){pyimport urllib; return urllib.quote(text, safe='~()*!.\\'')};
decodeURIComponent = unescape;""")
That's just a basic example that can handle most common instances, you might need to extend on it if you need unicode support or hit a corner case.
Cool
That's an omission, will fix that problem soon!
This is still broken =P
js2py.base.PyJsException: ReferenceError: decodeURIComponent is not defined
Is this js command not supported? Thanks