mathiasbynens / jquery-placeholder

A jQuery plugin that enables HTML5 placeholder behavior for browsers that aren’t trying hard enough yet
https://mths.be/placeholder
MIT License
3.98k stars 1.34k forks source link

Not compatible with jQuery 1.10.2 #165

Closed benjaminpick closed 9 years ago

benjaminpick commented 11 years ago

When downloading your demo.html and running locally, I get the following error (in IE 9):

Object doesn't support property or method 'placeholder'

The live demo site (jQuery 1.9.1), works nicely, though.

RyanGladstone commented 10 years ago

That's bizarre. I'm able to get Placeholder working with jQuery 1.10.2 on IE8. Do you have a fiddle demonstrating the issue?

benjaminpick commented 10 years ago

Here's a fiddle: http://jsfiddle.net/bpickyellowtree/mSK8b/4/

(Fiddle doesn't seem to work with IE8)

gin93r commented 10 years ago

I'm actually getting this same error using the latest 1.10.2 emulating IE9 and IE8 with IE11. Currently the demo seems to work with 1.10.2 but I'm not doing anything different other than shimming it with requirejs. @benjaminpick were you able to get this working?

Edit: I ended up getting this working.

amerikan commented 9 years ago

@gin93r what did you do on your end to get this working?

gin93r commented 9 years ago

@erikmontes In my require.js config I added it to shim with jquery as a dependancy.

    requirejs.config{{
        "paths":{
            "jquery":"path.to.jquery",
            "jquery.placeholder" : "path.to.jquery.placeholder"
        },
        shim: { "jquery.placeholder" { deps:['jquery'] } 
    })
getsetbro commented 9 years ago

Seems like this was due to jQuery not being included and this issues should be closed?

amerikan commented 9 years ago

@getsetbro i think for gin9er that was the case. I don't know about the OP. I personally, haven't tested it with 1.10.2, have you tested it with 1.10.2 by any chance?

@benjaminpick are you still getting the error? If not I will close this.

getsetbro commented 9 years ago

I do not have IE8 available but the fiddle above is pointing to jQuery version 1.11.0 not 1.10.2.

amerikan commented 9 years ago

@benjaminpick The fiddle is also pointing to incorrect path for the placeholder plugin in the External Resources section. It's pointing to https://raw2.github.com/mathiasbynens/jquery-placeholder/master/jquery.placeholder.js which gives 404, so it doesn't even load the plugin.

amerikan commented 9 years ago

Closing as I cannot reproduce and jsfiddle provide is not setup correctly (wrong reference to plugin).