The JSON-pieced DOM object cannot be found directly with. class or #id. How to find me, and I didn't figure out a specific rule. Anyway, try several methods will find out, here I used the native JS
The jquery selector is also used
//Add right FlowfunctionAddl () {vard=$ ("#dg2"). DataGrid ("GetSelected")); varStr= "<tr><td class=" onclick= ' TD (This) ' id= "+d.id+" > "+d.username+" </td></tr> "; $("#table"). append (str);}//When you click TD, add StylefunctionTD (a) {varCls= "TRTD"; varCl=a.getattribute ("Class"); if(cl==NULL|| cl== "") {A.classlist.add ("TRTD"); }Else{a.classname=""; } }//Remove Right Flowfunctionremovel () {varT = $ ("#table"). Find ("tr TD[CLASS=TRTD]"); $ (t). Remove (); }
2. In the process of using Easyui, it is found that data returned after the form form submission is parsed using Eval. The rest of the AJAX request methods such as $.ajax, $post, $get these returned data is not required to be parsed with eval, directly can be data. Out of the properties
var result=eval (' (' +data+ ') '); --easyui,form Submit
3. Adding a Delete class attribute to the object to which the JSON is spelled by using JS
Let's say HTML5 's newly added Classlist property (Ie10 below) Add a method Add (Class1, Class2, ...) to add one or more class names to the element. Use the [JavaScript] view plain Copy to view the code slices on codes to derive to my Code slice document.getElementById ("id"). Classlist.add ("A", "B", "C" ) ); Added three classes to DOM object if you need to erase all of the original, re-add the method of using the assignment [JavaScript] view plain copy on code to see a snippet derived from my Code slice document.getElementById ( "id"). className = "Class";
About the manipulation of Dom objects pieced together with JSON and the way Easyui are submitted