You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 2, 2025. It is now read-only.
Arthur Guiot edited this page Jul 4, 2017
·
1 revision
How it works?
This function is basically a function to prevent Cross-site scripting. So what this function does is that you give it a string and it returns you the same string but with encoded special characters.
How to use it?
It's super simple, you just need to give it a string, like that:
// Creating DisplayJS variablevar$=newDisplayJS(window);// String we want to encodevarstr="<b>After conversion, I won't be interpreted as HTML 😊</b>";// Executing the functionvarresult=$.xss(str)// printing the resultconsole.log(result)
$.xssURI()
Want to send GET data but you can have html in it? Instead of $.xss(), just use $.xssURI(). It works exactly the same as $.xss().
⚠️ Questions?
Don't hesitate to ask your questions ⁉️ in the issue part 😁