我试图将Person.js中的Person.js属性指向App.js中的nameChangedHandler事件侦听器。
Person.js代码
const person = ( props ) => {
return (
<div className="Person">
<p onClick={props.click}>I'm {props.name} and I am {props.age} years old!</p>
<p>{props.
以下JS代码在Safari上正常工作:
var a = $('.shell a')[0];
var evObj = document.createEvent('MouseEvents');
evObj.initMouseEvent('click', true, true, window);
a.dispatchEvent(evObj);
然而,这一行
evObj.initMouseEvent('click', true, true, window);
在Firefox中给出以下错误:
TypeError: Not enough a
在file1.js中,我读到:
// NOTE: initialize your app event handlers here, see file2.js for a simple event handler example
// TODO: configure following to work with both touch and click events (mouse + touch)
// see http://msopentech.com/blog/2013/09/16/add-pinch-pointer-events-apache-cordova-phonegap-app/