Front-end small essays

The front end of the reflector: 
HTML:
<li><a href="javascript:;" operation="executeCase">执行</a></li>
<li><a href="javascript:;" operation="deleteCase">删除</a></li>

//
JS Code: var operation = $ ( the this ) .attr ( 'operation' ); // find the operation property, IF ( typeof (window [operation]) == "function" ) {// If this variable is a function you function window [operation] () // () to perform this function } function executeCase() {} function deleteCase() {}

 

Guess you like

Origin www.cnblogs.com/wanghuijie1/p/11876493.html