documentcloud / documentcloud-pages

Responsively embed DocumentCloud pages.
https://documentcloud.github.io/documentcloud-pages/examples/
MIT License
22 stars 10 forks source link

Direct embed doesn't work for sites that already have jQuery #19

Closed AshKyd closed 9 years ago

AshKyd commented 9 years ago

When using the direct embed method on sites that already use jQuery, the jQuery bundled into documentcloud-pages clobbers the existing instance (including plugins) and breaks stuff.

The same issue probably applies to Underscore and Backbone too, though I'm not familiar enough with those to comment in depth.

Ideally jQuery shouldn't be bundled into the final build because it's a fair assumption that sites either have jQuery or can add it easily enough if they need to.

reefdog commented 9 years ago

@AshKyd I can't replicate this. Can you provide an example?

I was able to replicate by removing noConflict() from our setup assignment, but that's why we use it. As-is, it didn't clobber parent page jQuery or its extensions.

(Side note: I'd love to remove jQuery from this bundle to reduce embed package size. That's a post-launch enhancement.)

AshKyd commented 9 years ago

Hm, I can't reproduce it in a test case, but I had the issue loading it into a complex page in my dev environment. I'll have more of a play and see if I can reproduce this.

reefdog commented 9 years ago

Mmkay, I'll close this for now. Feel free to re-open if you create a reliable test case!