📄 emailfriend.js
字号:
// developerWorks e-mail to a friend JavaScript// initialize global var for new window object// so it can be accessed by all functions on the pagevar emailWindow // set flag to help out with special handling for window closingvar isIE3 = (navigator.appVersion.indexOf("MSIE 3") != -1) ? true : false// make the new window and put some stuff in itfunction newWindow() { var output = "" emailWindow = window.open("","subwindow","HEIGHT=500,WIDTH=600") // take care of Navigator 2 if (emailWindow.opener == null) { emailWindow.opener = window } output += "<html><BODY BGCOLOR='#FFFFFF' TEXT='#000000'>" output += "<table border='0' cellpadding='0' cellspacing='0'>" output += "<tr valign='top' align='left'>" output += "<td colspan='4' width='100%' bgcolor='#cc6633'><img src='../i/c.gif' height='5' width='1' alt='spacer gif'></td>" output += "</tr>" output += "<tr valign='top' align='left'>" output += "<td colspan='4' width='100%' bgcolor='#000000'><img src='../i/c.gif' height='1' width='1' alt='spacer gif'></td>" output += "</tr>" output += "<tr valign='top'>" output += "<td align='left'><img src='../i/c.gif' height='1' width='5' alt='spacer gif'></td>" output += "<td align='left'><img src='../i/email.gif' height='45' width='215' alt='e-mail it!'></td>" output += "<td align='right'><img src='../i/dw-logo2.gif' height='27' width='123' alt='developerWorks'></td>" output += "<td align='right'><img src='../i/c.gif' height='1' width='5' alt='spacer gif'></td>" output += "</tr>" output += "<tr valign='top'>" output += "<td align='left'><img src='../i/c.gif' height='1' width='5' alt='spacer gif'></td>" output += "<td colspan='2'><font FACE='HELVETICA, HELV, ARIAL' SIZE='-1'>Share this developerWorks content with others who you think will find it interesting, useful, or even amusing. Be sure to separate multiple e-mail addresses with a comma.</font><br /><br /></td>" output += "<td align='left'><img src='../i/c.gif' height='1' width='5' alt='spacer gif'></td>" output += "</tr>" output += "<tr valign='top'>" output += "<td align='left'><img src='../i/c.gif' height='1' width='5' alt='spacer gif'></td>" output += "<td colspan='2' bgcolor='#ffcc66'>" output += "<form method='post' action='http://www-4.ibm.com/cgi-bin/software/developer/emailfriend.cgi'>" output += "<input type=hidden name=subject value=\"" + justTitle + "\">" output += "<input type=hidden name=url value=\"" + document.location.href + "\">" output += "<input type=hidden name=body value=\"" + emailAbstract + "\">" output += "<table cellpadding=5 cellspacing=0 border=0 width=100%>" output += "<tr valign=top align=left>" output += "<td width=80><FONT FACE='HELVETICA, HELV, ARIAL' SIZE='-1'><b>Title:</b></FONT></td><td><FONT FACE='HELVETICA, HELV, ARIAL' SIZE='-1'><b>" + justTitle + "</b><br />" + emailAbstract + "</FONT></td>" output += "</tr>" output += "<tr valign=top align=left>" output += "<td width=80><FONT FACE='HELVETICA, HELV, ARIAL' SIZE='-1'><b>Send to:</b></td><td><input type='text' size='30' name='email'></FONT></td>" output += "</tr>" output += "<tr valign=top align=left>" output += "<td width=80><FONT FACE='HELVETICA, HELV, ARIAL' SIZE='-1'><b>Your name:</b></td><td><input type='text' size='30' name='fromName'></FONT></td>" output += "</tr>" output += "<tr valign=top align=left>" output += "<td width=80><FONT FACE='HELVETICA, HELV, ARIAL' SIZE='-1'><b>Your e-mail address:</b></td><td><input type='text' size='30' name='fromEmail'></FONT></td>" output += "</tr>" output += "<tr valign=top align=left>" output += "<td width=80><FONT FACE='HELVETICA, HELV, ARIAL' SIZE='-1'><b>Comments:</b></td><td><textarea name='comments' rows='3' cols='50'></textarea></FONT></td>" output += "</tr>" output += "<tr valign=top align=left>" output += "<td width=80> </td><td><input type='image' border='0' name='Send' src='../i/btn-send.gif' border='0' height='19' width='47' alt='send'><A HREF='javascript:void parent.close()'><img src='../i/btn-close.gif' border=0 height='19' width='103' alt='Close window'</a></td>" output += "</tr>" output += "</table>" output += "</td>" output += "<td align='left'><img src='../i/c.gif' height='1' width='5' alt='spacer gif'></td>" output += "</tr>" output += "</table>" output += "</html>" emailWindow.document.write(output) emailWindow.document.close()} // close subwindow, including ugly workaround for IE3function closeWindow() { if (isIE3) { // if window is already open, nothing appears to happen // but if not, the subwindow flashes momentarily (yech!) emailWindow = window.open("","subwindow","HEIGHT=200,WIDTH=200") } if (emailWindow && !emailWindow.closed) { emailWindow.close() } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -