달력

52024  이전 다음

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
function autoHTML( strSrc,optAtt ) {  
// This function will make http,https,ftp,www and email strings clickable.
strSrc = strSrc.replace( /\s(https:\/\/|http:\/\/|ftp:\/\/|www.)([^\s]*)/gi,
' <a href=http://$2 ' + optAtt + '>$1$2</a>' );
strSrc = strSrc.replace( /\s([^\s]*@[^\s]*)/gi,' <a href=mailto:$1>$1</a>' );
return strSrc;
}
function smartRmHTML( strSrc ) {
// Strip off HTML tags. Better than other removeHtml functions out there.
return server.HTMLEncode( strSrc.replace( /<[^<|>]+?>/gi,'' ) );
}
function listAllLinks( strSrc,blnClickable,optAtt ) {
// Extract every link in string and list them in order.
var arrAllLinks
if ( !blnClickable ) {
arrAllLinks = strSrc.match(/(https:\/\/|http:\/\/|
ftp:\/\/|www.)([^\s]*)/gi );
return arrAllLinks.join( ',' );
}
else {
arrAllLinks = strSrc.match(/(https:\/\/|http:\/\/|ftp:\/\/|www.)([^\s]*)/gi );
return arrAllLinks.join( ',' ).replace( /(https:\/\/|http:\/\/|ftp:\/\/|www.)([^,]*)/gi,
'<a href=http://$2 ' + optAtt + '>$1$2</a>' );
}
}
Posted by tornado
|