Thursday 15 September 2011

Calling a function as a function in javascript/jQuery -


I want to know that the fastest way to repeat the "function" under one name or to give it So that I call it in another document within another function - & gt; runTheFunction ();

Code:

  $ ('body'). Var id = self.data ("id"); var url = $ ("# manufacturers_table") data. ("Manufacturer" _ "_" Infourl "); var data_ar = {id: Id}; Ajaxcol (url, data_array, "rhs_info");});    

If I think everything is okay: ActionOnClick (e, alternative id) {var nodeRef = Optional Id? Document.getElementById (Optional Id): if it is (typef ee = == 'Object') e.preventDefault (); Var self = $ (this); var id = nodeRef.data ("id"); var url = $ ("# manufacturers_table"). Data ("infourl"); Var data_array = {id: id}; Ajaxcol (url, data_array, "rhs_ Info ");} // --- $ ('body'). (" Click ",". Manufacturer._details_link ", bodyOnClick); // --- body-click ('some node');

But actually, calling bodyOnClick does not make much sense because it will not < Em> HTMLElement . Therefore it only makes sense if you reuse the method on other event handlers, or explicitly

  bodyOnClick. Calls like call (someNodeReference);   



No comments:

Post a Comment