Web-project Fault repair function delivers all event_id data to the backend

Source: Internet
Author: User

1 <Scriptlanguage=javascript>2 functionIdentifyrepair (event_id)3 {4         varURL;5 URL= "/view/faultyinfo?event_id=" +event_id;6 window.location.href=URL;7 }8 9functionGeteventid ()10{11varevid_list=Document.getelementsbyname ("evid_list");12varEvid_info= "";13 for(varJ=0; J<Evid_list.length; J++){14Evid_info+=Evid_list[j].value+ " ";15  }16 17varURL;18URL= "/view/faultyinfo?event_id=" +Evid_info;19window.location.href=URL;20} + </Script> A  at <Body> -  - <Tableclass=titlewidth=700> -     <TR> -         <TD><b>Fault information</b></TD> -         <TDstyle= "Font-size:12px;color: #185A73"Align=rightwidth=*>{% Module Uptime ()%}</TD> in     </TR> - </Table> to  + <BR> - {% if lists! = []%} the  <input type= "button" onclick= "Geteventid ()" value= "Repair All" > * {% END%} $ <BR>Panax Notoginseng {% for D in lists%} - <Tablewidth=900Border=0cellspacing=1cellpadding=1> the     <TRID=TBLHDRHeight=22> +         <VDBwidth=200Align=center>Time</TD> A         <TDwidth=300Align=center>event_id</TD> the         <TDwidth=150Align=center>msg_id</TD> +         <TDwidth=150Align=center>SEVERITY</TD> -         <TDAlign=center> $ {% if d[' event_id ']%} $                 <astyle= "COLOR: #0000ff"  - href= "Javascript:identifyrepair (' {{d[' event_id '}} ')">Repair</a> - {% END%} the         </TD> -     </TR>Wuyi  the     <TRID=row1> -         <TDAlign=center>{{d[' time '}}</TD> Wu         <TDAlign=center>{{d[' event_id '}}</TD> -         <TDAlign=center>{{d[' msg_id '}}</TD> About         <TDAlign=center>{{d[' severity '}}</TD><input name= "evid_list" type= "hidden" value={{d[' event_id ']}}/> -      -     </TR>

With 57 lines of code, each execution of the line code will be event_id into input name= "evid_list"

With 34 lines of code, click Button, execute JS code geteventid (), store all the event_id in the variable evid_info, and finally pass to the background

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.