- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
/** Связанный JavaScript **/
/*
var script = new Array();
var s = 0;
linked = e.match(/<script type=("|')text\/javascript("|') src=("|').*?("|')><\/script>/gi);
if (linked != null)
{
src_link = new Array();
j = 0;
for (i = 0; i < linked.length; i++)
{
e = e.replace(linked[i], '');
new_link = linked[i].match(/src=("|').*?("|')>/gi);
if (new_link != null)
{
script[s] = document.createElement('script');
script[s].setAttribute('type', 'text/javascript');
script[s].id = 'JavaScript_' + hist.length + '_' + j;
script[s].setAttribute('src', new_link[0].substr(5, (new_link[0].length - (5 + 2))));
s++; j++;
}
}
}
*/
/** Внедрённый JavaScript **/
/*
e = e.replace(/[\r\n]/g, ' ');
intruded = e.match(/<script type=("|')text\/javascript("|')>.*?<\/script>/gi);
if (intruded != null)
{
for (i = 0; i < intruded.length; i++)
{
inner = '';
e = e.replace(intruded[i], '');
inner = intruded[i].replace(/<script type=("|')text\/javascript("|')>/, '').replace(/<\/script>/, '');
if (navigator.appName == 'Microsoft Internet Explorer')
{
script[s] = inner;
}
else
{
script[s] = document.createElement('script');
script[s].setAttribute('type', 'text/javascript');
script[s].id = 'JavaScript_' + hist.length + '_' + i;
script[s].innerHTML = inner;
}
s++;
}
}
*/
А вставить в элемент и найти через getElementsByTagName("script") слишком просто :D