I have the following:
$.fn.myFunction = (action) ->
console.log "hello!"
and when i call
$(".myDiv").myFunction()
it works fine in firefox, chrome, and safari but it fails in IE.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Your jQuery selector is one that looks for an element with tag “myDiv”:
Internet explorer tends not to like that. Are you really “inventing” elements?
Perhaps you meant to look for this:
In that case, your selector would be “#myDiv”:
Note that
consoledoesn’t exist before (I think) IE8.