实时编辑网页网页文字实时编辑,如同TEXTBOX一般
body{
font-family: verdana;
font-size: .9em;
}
input, textarea, pre{
font-family: verdana;
font-size: inherit;
font-family: inherit;
}
label{
width: 110px;
}
#userName, #userName_field{
font-size: 14px;
}
#cityName, #cityName_field{
font-size: 14px;
background-color: #333;
color: #fff;
}
#blogTitle, #blogTitle_field{
font-size: 24px;
}
#blogText, #blogText_field{
width: 240px;
}
#lorumText, #lorumText_field{
width: 500px;
}
function datosServidor() {
};
datosServidor.prototype.iniciar = function() {
try {
// Mozilla / Safari
this._xh = new XMLHttpRequest();
} catch (e) {
// Explorer
var _ieModelos = new Array(
'MSXML2.XMLHTTP.5.0',
'MSXML2.XMLHTTP.4.0',
'MSXML2.XMLHTTP.3.0',
'MSXML2.XMLHTTP',
'Microsoft.XMLHTTP'
);
var success = false;
for (var i=0;i ";
else
actual.innerHTML = "" + actual.innerHTML + "";
changing = true;
}
actual.firstChild.focus();
}
//find all span tags with class editText and id as fieldname parsed to update script. add onclick function
function editbox_init(){
if (!document.getElementsByTagName){ return; }
var spans = document.getElementsByTagName("span");
// loop through all span tags
for (var i=0; i
setVarsForm("pageID=profileEdit&userID=11&sessionID=28ydk3478Hefwedkbj73bdIB8H");
Your name: John Doe
Your city: Rotterdam, NL
AJAX instant edit script - clean HTML
Welcome to my blog. Today i created this instant
update script. Click here to try! If you like it you can download and view the source at:
yvoschaap.com. Have fun and success.
Message of the day:Time Spend Wishing, Is
Time Wasted
Check the source code of this page. No crazy JS!!
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut faucibus commodo lacus. Donec
egestas magna et risus.
Etiam velit tellus, sagittis eget, pretium eu, sagittis ut, sem. Aliquam est. Nam
condimentum. In massa ligula, varius in, aliquet vehicula, facilisis id, ante. Sed purus.
Vestibulum tempus facilisis lectus. Phasellus convallis, lorem in bibendum convallis, nunc
nisl fringilla sem, ut nonummy turpis nunc sed risus. Aliquam bibendum semper ipsum.
In hac habitasse platea dictumst. Maecenas vulputate, nisl nec tempus rutrum, tortor ligula
interdum urna, eget porttitor risus sem eu odio.
Nullam vel leo sed enim sodales euismod. Phasellus volutpat purus sit amet erat. Nulla ut
enim. Nullam tempus enim eget lacus. Nulla a nibh eu enim bibendum bibendum. Nunc justo.
Vivamus sagittis sollicitudin lacus. Duis lacinia nisi et lectus. Etiam ac felis et est
sagittis aliquam. Duis vitae nulla. Nam sed nibh. Mauris fermentum sodales nulla. Nam
fringilla. In hac habitasse platea dictumst. Aliquam erat volutpat. Fusce consectetuer.
[Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]