Link to home
Start Free TrialLog in
Avatar of conrad2010
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
ASKER CERTIFIED SOLUTION
Avatar of sammySeltzer
sammySeltzer
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial