fixed #2224 : Update the JS binding code for plugin.