123 Eng

Engineering the engineers™


Latest Jobs   Forum Map

 


Home

Source Codes

Engineering Colleges

BE Students

Training  Reports (updated)

Seminar Reports (updated

Placement Papers (updated)

Forums

   Computer Science / IT

   Electronics

   Electrical

   Mechanical

   Chemical

   Civil

   CAT / MBA

   GMAT / Foreign MBA

Latest Jobs

Engineering Jobs / Technical Jobs

Management Jobs

Sitemap

About-Us

Terms of use

Displaying  Source Code(s)  
 

 
Remove Javascript from HTML

--------------------------------------------------------------------------------



<%
function clearJS(str)
clearJS = str
Set regEx = New RegExp
'This gets rid of onclick and such
oncmds = "Click|DblClick|KeyDown|KeyPress|KeyUp|MouseDown"&_
"|MouseMove|MouseOut|MouseOver|MouseUp"
regEx.Pattern = "(on("& oncmds &")[^>])"
regEx.IgnoreCase = True
regEx.Global = True
clearJS = regEx.Replace(clearJS, "")
'This takes out the ability to use javas
' cript: with href
clearJS = Replace(clearJS, "javascript:", "")
'This clears out < script > tags
regEx.Pattern = "(<[s]c[^>]*>)"
regEx.IgnoreCase = True
regEx.Global = True
clearJS = regEx.Replace(clearJS, "")
regEx.Pattern = "(</[s]c[^>]*>)"
regEx.IgnoreCase = True
regEx.Global = True
clearJS = regEx.Replace(clearJS, "")
End function
%>
 

 

Contribute content or training reports / feedback / Comments
job placement papers
All rights reserved © copyright 123ENG