JSFiddle - React, Tailwind, and code Playground
by jeffrod
HTML
<input type="text"/>
<script type="javascript">
//this represents my file that i have control over. this
//js snippet runs after the framework
function dosomething()
{
console.log('overwritten')
}
</script>
JavaScript
//this javascript file represents the framework that i cannot change
function createHandler(scope, method)
{
return function ()
{
return method.apply(scope, arguments);
}
}
function dosomething()
{
console.log('original');
}
$(function()
{
var someObject = { 'a':'aaa' }
$('input').keypress(createHandler(someObject,dosomething));
});