Skip to content

Instantly share code, notes, and snippets.

@rhysburnie
rhysburnie / jquery-ajax-dataFilter.js
Last active January 17, 2022 22:02
jQuery ajax dataFilter to remove scripts from html string to prevent script execution if loading string into a temp dom element
function dfStripScripts = function(data, type)
{
// incase the response is full html with scripts remove them
type = type || 'text';
if(type=='html'||type=='text'){
/*return data.replace(/<script.*>.*?<\/script>/gi, '');*/
return data.replace(/<script.*?>([\w\W\d\D\s\S\0\n\f\r\t\v\b\B]*?)<\/script>/gi, '');
}
return data;
};
@kevinSuttle
kevinSuttle / meta-tags.md
Last active March 31, 2024 14:26 — forked from lancejpollard/meta-tags.md
List of Usable HTML Meta and Link Tags