网站开发与移动开发

博客园 首页 新随笔 管理

2009年8月27日 #

摘要: 用PHP来快速将纯ASCII文本完美地转换成为可读的HTML标记。 首先让我们来看一个我朋友希望转换的纯文本文件的例子: 以下为引用的内容: Green for Mars! John R. Doe The idea of little green men from Mars, long a staple of science fiction, may soon turn out to be less fantasy and more fact. Recent samples sent by the latest Mars exploration team indicate a ... 阅读全文
posted @ 2009-08-27 08:41 txf2004 阅读(223) 评论(0) 推荐(0)

摘要: 要求: 遍历所有文本框的值并判断是否为数字 思路: 大家知道文本框input的type为text,所有我们只要遍历所有input,判断其type是否为text,然后再判断指定字段的值即可达到要求 具体代码如下: var aa = document.getElementsByTagName("input"); var bb = 0; for(var i=0;i<aa.length;i++) { var avalue = aa[i].value; var atype = aa[i].type; if(atype == "text") bb++; } a 阅读全文
posted @ 2009-08-27 08:40 txf2004 阅读(144) 评论(0) 推荐(0)