本帖最后由 彼岸天堂 于 2011-12-19 11:33 编辑
Hi,大家好!最近在写IE脚本时遇到一个问题,由于本人接触autoit时间不长,无法实现对js按钮的点击,还请大神多多指教!
要点击的按钮源代码:<html>
<head>
<lm:msg/>
<title>XXXXXXXX</title>
<META HTTP-EQUIV="Expires" CONTENT="0">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="/nbWeb/css/menu.css" rel="stylesheet" type="text/css">
<style type="text/css">
body {
background: #FFFFFF;
font-family: Arial, "Times New Roman", Times, serif;
font-size: 10pt;
border: 0;
margin: 0;
overflow: hidden;
}
html {
border: 0;
overflow: hidden;
}
.menu-bar {
border-bottom: 2px groove;
}
.warning {
color: red;
}
a:link {
color: #0257CC;
text-decoration: none;
}
a:visited {
color: #0257CC;
text-decoration: none;
}
a:hover {
color: red;
text-decoration: none;
}
a:active {
color: red;
text-decoration: none;
}
</style>
<script type="text/javascript" src="/nbWeb/js/poslib.js"></script>
<script type="text/javascript" src="/nbWeb/js/scrollbutton.js"></script>
<script type="text/javascript" src="/nbWeb/js/menu.js"></script>
<script type="text/javascript" src="/nbWeb/js/public.js"></script>
</head>
<body>
<div align="center"><img width="100%" height="80" align="middle" src="images/BusinessTitle.jpg"></div>
<script type="text/javascript">
Menu.prototype.cssFile = "/nbWeb/css/menu.css";
Menu.prototype.mouseHoverDisabled = false;
var tmpItem;
var M1 = new MenuBar();
var M111 = new Menu();
var M11103 = new Menu();
M11103.add( tmpItem =new MenuItem('日终处理' ,'management/duizhang/duizhang.jsp?func_id=1110321' ));
tmpItem.target="main";
M11103.add( tmpItem =new MenuItem(' 系统对帐' ,'management/duizhang/dzcl.jsp?func_id=1110322' ));
tmpItem.target="main";
M11103.add( tmpItem =new MenuItem('对账结果查询' ,'management/duizhang/dz_jg_main.jsp?func_id=1110323' ));
tmpItem.target="main";
M111.add(new MenuItem('系统管理', null,null, M11103 ) );
M1.add( tmp = new MenuButton( "管理",M111 ));
M1.write();
</script>
<div id="div_style" style="position:absolute; left:0 px; top:0 px; width: 700 px; height:80 px; background-color:#FFCC00; filter:alpha(opacity=80); visibility:visible;">
<IFRAME id="iMsg" name="iMsg" height="80 px" width="700 px" border=0 framespacing=0 frameborder=0 src="/nbWeb/common/help.jsp"></IFRAME>
</div>
</body>
<script language='javascript'>
var sIDS=document.getElementById("div_style");
var wth=sIDS.style.width;
var w_v=wth.substring(0,wth.length-2);
sIDS.style.left=(screen.width-w_v) +'px';
function changeStyle(obj){
var pulg = obj.value;
if(pulg=="信息开"){
obj.value="信息关";
}else {
obj.value="信息开";
}
var sIDS=document.getElementById("div_style");
var vu=form1.styleVu.value;
if(vu=="block"){
sIDS.style.display="none";
form1.styleVu.value="none";
}else if(vu=="none"){
sIDS.style.display="block";
form1.styleVu.value="block";
form1.action="/nbWeb/common/help.jsp";
form1.submit();
}
}
function removeMsg(){
iMsg.removeMsg();
}
</script>
<form name="form1" target="iMsg" action="/nbWeb/common/help.jsp">
<input type="hidden" name="styleVu" value="block">
</form>
</html>
<script language="javascript">
//重载,add by zhonggc,20070814
MenuItem.prototype.dispatchAction = function () {
//获得代理,add by zhonggc,20070814
var agent=parent.frames['userinfo'].getMyagent();
if ( this.disabled )
return;
this.setSelected( true );
if ( this.subMenu ) {
if ( !this.subMenu.isShown() )
this.showSubMenu( false );
return;
}
if ( typeof this.action == "function" ) {
this.setSelected( false );
this.parentMenu.closeAllMenus();
this.action();
}
else if ( typeof this.action == "string" ) { // href
this.setSelected( false );
this.parentMenu.closeAllMenus();
if ( this.target != null ){
if(this.target == "blank") {
var winWidth;
var winHeight;
var winFeatures;
winWidth=screen.width -10;
winHeight=screen.height - 80;
winFeatures="menubar=no,status=yes,toolbar=no,resizable=yes,titlebar=no,scrollbars=no,fullscreen=0,";
winFeatures+="top=0,left=0,height=" +winHeight + ",width=" + winWidth ;
blank = window.open( this.action, this.target, winFeatures);
} else {
if(agent[0]=="代理开"){
func=this.action.substring(this.action.indexOf("func_id=")+8);
//alert(agent[1]+";"+func);
if(agent[1].indexOf(func)==-1){
alert("代理用户没有此模块的权限!");
return ;
}
}
blank = window.open( this.action, this.target );
}
}
else{
document.location.href = this.action;
}
}
};
</script>
(我想点击的按钮为:管理-->系统管理-->系统对账) |