日期:2014-05-18 浏览次数:20416 次
function autotag2(){ var title = document.forms["myform"].txtTitle.value; // var Message = document.forms["myform"].LogContent.value; var oEditor = FCKeditorAPI.GetInstance('FCKeditor1') ; document.getElementById('hf_FCKEditor1').value=oEditor.GetXHTML(); debugger; var Message =document.forms["myform"].hf_FCKEditor1.value; var Str="title=" + escape(title) + "&Message=" + escape(Message) + "&m=" + Math.random(); document.forms["myform"].atuotag.disabled = true; if (title.length < 1) { alert("错误提示:没有填写标题! "); document.forms["myform"].atuotag.disabled = false; return false } if (Message.length < 1) { alert("错误提示:内容不能为空! "); document.forms["myform"].atuotag.disabled = false; return false } else { if (window.ActiveXObject) { xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } else if (window.XMLHttpRequest) { xmlHttp = new XMLHttpRequest(); } var url = "/ajaxmethod/tags.aspx?Action=jiu"; var query="title=" + escape(title) + "&Message=" + escape(Message) + "&m=" + Math.random(); xmlHttp.onreadystatechange = function() { if(xmlHttp.readyState == 4) { if(xmlHttp.status == 200) { var TempStr = xmlHttp.responseText; document.forms["myform"].atuotag.disabled = false; if (TempStr == 0) { alert("没有找到可用!") } else { document.forms["myform"].txtTags.value += TempStr } } else{ //alert("Ajax无返回!") } } } xmlHttp.open("POST", url, true); xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xmlHttp.send(query); //Ajax技术中的xmlhttp.send()方法提供我们传送大量数据的功能 } } </script>