﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-Mayer-随笔分类-script code</title><link>http://www.blogjava.net/mayer/category/9278.html</link><description>不论风吹浪打，胜似闲庭信步。
</description><language>zh-cn</language><lastBuildDate>Tue, 27 Feb 2007 12:19:03 GMT</lastBuildDate><pubDate>Tue, 27 Feb 2007 12:19:03 GMT</pubDate><ttl>60</ttl><item><title>form2XmlDoc</title><link>http://www.blogjava.net/mayer/archive/2006/03/31/38472.html</link><dc:creator>Mayer</dc:creator><author>Mayer</author><pubDate>Fri, 31 Mar 2006 06:02:00 GMT</pubDate><guid>http://www.blogjava.net/mayer/archive/2006/03/31/38472.html</guid><wfw:comment>http://www.blogjava.net/mayer/comments/38472.html</wfw:comment><comments>http://www.blogjava.net/mayer/archive/2006/03/31/38472.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/mayer/comments/commentRss/38472.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/mayer/services/trackbacks/38472.html</trackback:ping><description><![CDATA[
		<div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee">
				<span style="COLOR: #008000">/*</span>
				<span style="COLOR: #008000">*<br /> * create a xml document from the assigned form.<br /> * @param formName - the assigned form name<br /> * @param xmlEncoding - the character encoding of xml document<br /> * @return a xml docment<br /> </span>
				<span style="COLOR: #008000">*/</span>
				<span style="COLOR: #000000">
						<br />
				</span>
				<span style="COLOR: #0000ff">function</span>
				<span style="COLOR: #000000"> form2XmlDoc(formName, xmlEncoding) {<br />  </span>
				<span style="COLOR: #0000ff">var</span>
				<span style="COLOR: #000000"> xml </span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000">&lt;?xml version=\</span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000">1.0</span>
				<span style="COLOR: #000000">\</span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000"> encoding=\</span>
				<span style="COLOR: #000000">""</span>
				<span style="COLOR: #000000"> + xmlEncoding + </span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000">\</span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000">?&gt;\n</span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000">;<br />  xml </span>
				<span style="COLOR: #000000">+=</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000">&lt;FORM&gt;\n</span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000">;<br />  </span>
				<span style="COLOR: #0000ff">var</span>
				<span style="COLOR: #000000"> vForm </span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000"> document.forms[formName];<br />  </span>
				<span style="COLOR: #0000ff">for</span>
				<span style="COLOR: #000000"> (</span>
				<span style="COLOR: #0000ff">var</span>
				<span style="COLOR: #000000"> i</span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000">0</span>
				<span style="COLOR: #000000">; i</span>
				<span style="COLOR: #000000">&lt;</span>
				<span style="COLOR: #000000">vForm.length; i</span>
				<span style="COLOR: #000000">++</span>
				<span style="COLOR: #000000">)  {<br />    </span>
				<span style="COLOR: #0000ff">var</span>
				<span style="COLOR: #000000"> tmpName </span>
				<span style="COLOR: #000000">=</span>
				<span style="COLOR: #000000"> vForm[i].name;<br />        </span>
				<span style="COLOR: #0000ff">if</span>
				<span style="COLOR: #000000"> (tmpName) <br />            xml </span>
				<span style="COLOR: #000000">+=</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000">&lt;</span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">+</span>
				<span style="COLOR: #000000"> tmpName </span>
				<span style="COLOR: #000000">+</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000">&gt;</span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">+</span>
				<span style="COLOR: #000000"> vForm[i].value </span>
				<span style="COLOR: #000000">+</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000">&lt;/</span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">+</span>
				<span style="COLOR: #000000"> tmpName </span>
				<span style="COLOR: #000000">+</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000">&gt;\n</span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000">
						<br />  }<br />  xml </span>
				<span style="COLOR: #000000">+=</span>
				<span style="COLOR: #000000"> </span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000">&lt;/FORM&gt;</span>
				<span style="COLOR: #000000">"</span>
				<span style="COLOR: #000000">;<br />  </span>
				<span style="COLOR: #0000ff">return</span>
				<span style="COLOR: #000000"> xml;<br />}<br /></span>
		</div>
<img src ="http://www.blogjava.net/mayer/aggbug/38472.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/mayer/" target="_blank">Mayer</a> 2006-03-31 14:02 <a href="http://www.blogjava.net/mayer/archive/2006/03/31/38472.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>