At the end of Script/common.js to add the following words can realize the automatic Image Verification code refresh and comment content automatically save (forie)
Because of the Z-blog JS expansion mechanism is not good enough, in the case of the extension of things can only use Window.onload (IE).
Since the use of window.onload, then simply use Window.clipboarddata.
Are we looking forward to these two functions for a long time? Without Ajax, these two features are too important, too important, too important.
The actual function is not perfect because of congenital defects, the next version, the idea is to add a sentence below each page to read Loadextrascript ().
And then through this to automatically refresh the verification code, do not have the hand point (now use window.onload for automatic very slow, because to wait for the picture loading) in fact, should be in the IMG when the onload to trigger an automatic refresh verification code function objimage.src= objimage.src+ "&random=" +math.random () or verification code simply do not use any IMG tags, simply use the pure JS to ensure that after the back of the verification code also automatically refreshed, and now many large web sites is such a way!
Even the things that are now under each page are integrated into it.
By the way, the first two days suddenly thought of why the speed of reconstruction so slow, why the automatic installation script so fast ... Is it a little enlightening?? Can you do it as fast as an automated setup script? Oh, did you think of that? :)
Copy Code code as follows:
//*********************************************************
Purpose: Extend function entry
Input: None
Back: None
//*********************************************************
function Loadextrascript ()
{
try{
Validcoderefresh ();
Savecomment ();
}catch (e) {}
}
//*********************************************************
Objective: Automatically refresh the verification code after the mouse clicks the picture
Input: None
Back: None
//*********************************************************
function Validcoderefresh () {
var imgs= document.getelementsbytagname ("img");
var hint = document.createelement ("span");
Hint.innerhtml= "If you just press [back] please click on the picture Refresh verification Code";
for (var i = 0; i < imgs.length; i++) {
if (Imgs[i].src.indexof ("C_validcode.asp?name=commentvalid")!==-1) {
var objimage=imgs[i];
ObjImage.parentNode.appendChild (hint);
Objimage.attachevent (' onmouseover ', function () {objimage.style.cursor= ' hand ';});
Objimage.attachevent (' onclick ', function () {objimage.src=objimage.src+ "&random=" +math.random ();});
}
}
}
//*********************************************************
Purpose: Automatically save on clipboard after user submits comments
Input: None
Back: None
//*********************************************************
function Savecomment ()
{
var btnsumbit=document.getelementsbyname ("Btnsumbit");
var Txaarticle=document.getelementbyid ("Txaarticle");
var hint = document.createelement ("span");
Hint.innerhtml= "<p> your comments will be automatically saved on the Clipboard </p>."
TxaArticle.parentNode.appendChild (hint);
Btnsumbit[0].attachevent (' onclick ', function () {Window.clipboardData.setData ("Text", Txaarticle.innertext);});
}
//*********************************************************
Purpose: Extend function-load
Input: None
Back: None
//*********************************************************
Window.onload=loadextrascript;