16 Mayıs 2008 Cuma
Kaydol:
Yorumlar (Atom)
function replaceCarriageReturn(emailBody,replaceWith){emailBody = escape(emailBody); //encode all characters in text area to find carriage return characterfor(i=0; i <> -1) {//Windows encodes returns as \r\n hexemailBody=emailBody.replace("%0D%0A",replaceWith)}else if(emailBody.indexOf("%0A") > -1) {//Unix encodes returns as \n hexemailBody=emailBody.replace("%0A",replaceWith)}else if(emailBody.indexOf("%0D") > -1) {//Macintosh encodes returns as \r hexemailBody=emailBody.replace("%0D",replaceWith)}}emailBody=unescape(emailBody) //decode all characters in text area backalert(emailBody);}input type="button" onclick="replaceCarriageReturn(form1.body.value,'br />')" value="Replace Carriage Returns with Html Break Tag">