Implemented AJAX request for inserting date/time

SVN revision: 1838
This commit is contained in:
2007-04-12 19:16:55 +00:00
parent 30287cf9e7
commit 549aca223f
2 changed files with 44 additions and 10 deletions
+31 -2
View File
@@ -112,8 +112,37 @@ function queryHeading(text)
function insertTime(text)
{
selection = getSelection(text);
elcode1(text, '', datetime, selection);
var xmlHttp;
try {
xmlHttp = new XMLHttpRequest(); // Firefox, Opera 8.0+, Safari
}
catch (e) {
try {
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); // Internet Explorer
}
catch (e) {
try {
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e) {
alert("Your browser does not support AJAX!");
return false;
}
}
}
xmlHttp.onreadystatechange = function()
{
if(xmlHttp.readyState == 4)
{
selection = getSelection(text);
elcode1(text, '', xmlHttp.responseText, selection);
}
}
xmlHttp.open("GET","?cmd=gettimedate",true);
xmlHttp.send(null);
}
function elKeyInit()