Why a JavaScript function with some specific name is not working while others are? -
One of the most interesting problems I am facing these days is one of my JavaScript functions. My javascript work is not working with some specific names, but if I change its name to some other place then it is working. A look for the toolbar function to maintain jquery ui css -
// function retain_css () {Warning ('Hi'); $ ("#new_sort_options") .buttonset (); } // new type $ (document) .on ("click", ".new_sort_button", function () {var order = $ (this) .val (); var make_id = $ ('# new_make_id'). Val ( ); $ .ajax ({before: start_loader (), type: 'POST', url: '/ ajax / new-sort.php', data: 'order +' + order + '& amp; make_id =' + Make_id, data type: 'jason', success: work (data) {$ ("# new_saltts_tolbar") .html (data.toolbar); $ ("#new_update") .html (data.moles); retain_css () ; And_loader ();}});});
but retain_css () is not working at all. Even alert () is not firing but if I change my name like my_fun () then the code works I do not understand why this is happening? Any remedy? Do not worry about the end_loader () function because it does not have anything to deal with my problem. I have changed the sequence of code when retain_css () was being used but did not work.
Try not to create global functions, because it can collide with other frameworks or libraries .
// Define private namespace window.user3779493Functions = {}; // Defined method user3779493Functions.retain_css = function () {...} // call method user3779493Functions.retain_css ();
Comments
Post a Comment