Passing a function with parameters as a parameter?

Source: https://stackoverflow.com/questions/1300242/passing-a-function-with-parameters-as-a-parameter

Use a "closure":
$(edit_link).click(function(){ return changeViewMode(myvar); });
This creates an anonymous temporary function wrapper that knows about the parameter and passes it to the actual callback implementation.

Không có nhận xét nào:

ui-ux-pro-max-skill

 https://github.com/nextlevelbuilder/ui-ux-pro-max-skill Using CLI (Recommended) # Install CLI globally npm install -g uipro-cli # Go to...