我正在使用html在c#中形成良好的html,除了javascript之外所有进程都已完成,请帮助实现此目的:
我的html有javascript for ex:
<html><body><b>
<script type='text/javascript'>
<!--
var prefix = 'ma' + 'il' + 'to';
var path = 'hr' + 'ef' + '=';
var addy21908 = 'franchan' + '@';
addy21908 = addy21908 + 'sph' + '.' + 'com' + '.' + 'sg';
document.write('<a ' + path + '\'' + prefix + ':' + addy21908 + '\'>');
document.write(addy21908);
document.write('<\/a>');
//-->\n </script><script type='text/javascript'>
<!--
document.write('<span style=\'display: none;\'>');
//-->
</script>This email address is being protected from spambots. You need JavaScript enabled to view it.
<script type='text/javascript'>
<!--
document.write('</');
document.write('span>');
//-->
</script></b></a></body></html>
如何从上面的编码文件中获取准确的html输入?我期待的输出如:
<a href="mailto:franchan@sph.com.sg"><b>franchan@sph.com.sg<span style='display: none;'>This email address is being protected from spambots. You need JavaScript enabled to view it.</span></b></a>
目前我和“SGML”读者,XML编写器用于转换格式良好的HTML
此致,先谢谢,
萨兰
答案 0 :(得分:0)
我建议这样的事情
<script type='text/javascript'><![CDATA[
window.onload=function() {
var prefix = 'ma' + 'il' + 'to';
var addy88710 = ['franchan','@','sph','.','com','.','sg']
var link = document.createElement("a");
link.href=prefix + ':' + addy88710.join("");
link.innerHTML=addy88710.join("");
var span = document.getElementById("x");
span.innerHTML="";
span.appendChild(link);
}
//]]></script>
<span id="x">This email address is being protected from spambots. You need JavaScript enabled to view it.<span>
答案 1 :(得分:0)
如果您正在尝试保护电子邮件,另一个简单的解决方案是即时创建电子邮件的图像并将其放置在电子邮件文本必须到达的位置,这样垃圾邮件发送者就无法捕获它。也许改变图像,以便ocr也不能轻易阅读。