conrad2010
asked on
Convert sanetize function from VBScript to JavaScript
This is an ASP function... how would this work in JavaScript keeping the same syntax as ASP?
function sanitize(strText)
strText = REPLACE(strText,"'","''")
strText = REPLACE(strText,"~","")
strText = REPLACE(strText,"@","")
strText = REPLACE(strText,"#","")
strText = REPLACE(strText,"$","")
strText = REPLACE(strText,"%","")
strText = REPLACE(strText,"^","")
strText = REPLACE(strText,"&","")
strText = REPLACE(strText,"[","")
strText = REPLACE(strText,"]","")
strText = REPLACE(strText,"{","")
strText = REPLACE(strText,"}","")
strText = REPLACE(strText,"|","")
strText = REPLACE(strText,"\","")
strText = REPLACE(strText,"/","")
strText = REPLACE(strText,"<","")
strText = REPLACE(strText,">","")
strText = REPLACE(strText,"EXEC","")
sanitize = strText
end function
function sanitize(strText)
strText = REPLACE(strText,"'","''")
strText = REPLACE(strText,"~","")
strText = REPLACE(strText,"@","")
strText = REPLACE(strText,"#","")
strText = REPLACE(strText,"$","")
strText = REPLACE(strText,"%","")
strText = REPLACE(strText,"^","")
strText = REPLACE(strText,"&","")
strText = REPLACE(strText,"[","")
strText = REPLACE(strText,"]","")
strText = REPLACE(strText,"{","")
strText = REPLACE(strText,"}","")
strText = REPLACE(strText,"|","")
strText = REPLACE(strText,"\","")
strText = REPLACE(strText,"/","")
strText = REPLACE(strText,"<","")
strText = REPLACE(strText,">","")
strText = REPLACE(strText,"EXEC","")
sanitize = strText
end function
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.