I have an event listener that fires this (after attaching it using attachEvent or addEventListener):
How can I get the handleResponse to accept another variable?
Something like
I get an error obviously
I basically want to send through the string while still handling the event (e.data etc). The highlighted doesn't work
Any insights?
Code:
var handleResponse = function (e) {
if (e.data == "ready") {
//some stuff here
}
}
How can I get the handleResponse to accept another variable?
Something like
Code:
var handleResponse = function (e,stringhere) {
if (e.data == "ready") {
//some stuff here
}
}
I get an error obviously
Code:
var eventMethod = window.addEventListener ? "addEventListener" : "attachEvent"; //Cross-browser Functionality
var eventer = window[eventMethod];
var messageEvent = eventMethod == "attachEvent" ? "onmessage" : "message"; //Cross-browser Functionality
[b] eventer(messageEvent, handleResponse(e,'string'), false);[/b]
I basically want to send through the string while still handling the event (e.data etc). The highlighted doesn't work
Any insights?