![]() |
|
Ê×Ò³ ©¦ Apache ©¦ Linux©¦ Java©¦ MySQL©¦ ×¢²á©¦°ïÖú | |||
ÈçҪͶËß»òÌá³öÒâ¼û½¨Ò飬Çëµ½
Õ¾Îñ½¨ÒéͶËß°É·´À¡¡£
[PHP]
/// <»ù±¾ÐÅÏ¢>
/// <ÃèÊö>
/// Êä³ö Javascript
/// ÃèÊö>
/// <×÷Õß>
/// ÈÕ³ö¶«·½xp
/// ×÷Õß>
/// <×îºóÐÞ¸ÄÈÕÆÚ>
/// 2004.6.27
/// ×îºóÐÞ¸ÄÈÕÆÚ>
/// <°æ±¾>
/// 1.2
/// °æ±¾>
/// »ù±¾ÐÅÏ¢>
class Javascript
{
function Begin()
{
print "<script language=\"javascript\">\n";
}
function End()
{
print "</script>\n";
}
function Open($url, $target, $style)
{
print "open(\"" . $url . "\",\"" . $target . "\",\"" . $style . "\");\n";
}
function SetValue($name,$value,$form="")
{
print "\tSetValue(\"" . $name . "\",\"" . $value . "\"" . ($form==""?"": ",\"" . $form . "\"") . ");\n";
}
function GoToUrl($url,$wnd="")
{
print ($wnd!=""?$wnd.".":"")."window.location.href=\"" . $url . "\";\n";
}
function Alert($msg)
{
print "alert(\"" . $msg . "\");\n";
}
function GoBack()
{
print "history.back();\n";
}
function CloseWindow()
{
print "window.close();\n";
}
}
[/PHP]
SetValue ÐèҪһЩjsº¯ÊýµÄÖ§³Ö
CODE: function SetValue(name,value) { theForm="document.forms[0]"; if(arguments.length==3) theForm = arguments[2]; theForm=eval(theForm); //alert(name.type); for(i=0;i<theForm.elements.length;i++) { if(theForm.elements[i].name==name) { //¸´Ñ¡¿ò if(theForm.elements[i].type=="checkbox") { if(theForm.elements[i].value==value) { theForm.elements[i].checked=true; } } //µ¥Ñ¡°´Å¥ if(theForm.elements[i].type=="radio") { if(theForm.elements[i].value==value) { theForm.elements[i].checked=true; } } //ÊäÈë¿ò if(theForm.elements[i].type=="text" || theForm.elements[i].type=="hidden" || theForm.elements[i].type=="textarea") { theForm.elements[i].value=value; } //ÏÂÀÁбí if(theForm.elements[i].type=="select-one") { for(j=0;j<theForm.elements[i].length;j++) { if(theForm.elements[i][j].value==value) { theForm.elements[i][j].selected=true; } } } //-- } } return; } |

