要异步传输的数据:
Xml代码
....
<action xsi:type="basic:JavaScript" script="index += 1;"/>
....
Ajax异步传输代码:
Js代码
复制代码 代码如下:
var postData = "input="+ escape(inputJSON) +"&script="+escape(xml)+
"&feedGeneral=" + escape(feedGeneral);
XmlHttpRequest.open("POST",url,true);
XmlHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
XmlHttpRequest.send(postData);
复制代码 代码如下:
Control names and values are escaped. Space characters are replaced by `+', and then reserved characters are escaped as
described in [RFC1738], section 2.2: Non-alphanumeric characters are replaced by `%HH', a percent sign and two hexadecimal
digits representing the ASCII code of the character. Line breaks are represented as "CR LF" pairs (i.e., `%0D%0A').
复制代码 代码如下:
$('test').innerHTML = "<form target='_blank' action='./gen_feed' method='post'>"
+ "<input type='text' /><input type='text' />"
+ "<input type='text' /><input type='hidden' value='" + this.feed_type + "'
/>"
+ "<input type='submit' value='gen' /></form>";
var test_form = $('test_form');
test_form.elements[0].value = inputJSON;
test_form.elements[1].value = script;
test_form.elements[2].value = feedGeneral;
test_form.submit();
新闻热点
疑难解答
图片精选