Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught TypeError #15

Open
ontic opened this issue Mar 30, 2014 · 5 comments
Open

Uncaught TypeError #15

ontic opened this issue Mar 30, 2014 · 5 comments

Comments

@ontic
Copy link

ontic commented Mar 30, 2014

I thought I'd try integrating pizza with a Magento extension I'm currently developing, however I can't even include pizza.js without this error occurring:

Line: 247 $.extend(Pizza, {

Message from Chrome:

Uncaught TypeError: Object function $(element) {
  if (arguments.length > 1) {
    for (var i = 0, elements = [], length = arguments.length; i < length; i++)
      elements.push($(arguments[i]));
    return elements;
  }
  if (Object.isString(eleme...<omitted>...d' 

When I try using pizza.js version 0.1.1 from http://geoffgraham.me/wp-content/themes/GeoffGrahamFour/lib/javascripts/pizza.js everything works fine, but I'd prefer to use the latest version.

@ontic
Copy link
Author

ontic commented Mar 31, 2014

Urr... I might just go with raphael and g.raphael then

@mrsweaters
Copy link
Contributor

Thank you for reporting. I'm not exactly sure what is causing your problem. Can you post a link to an example? Sorry for the delay.

@ontic
Copy link
Author

ontic commented Apr 14, 2014

I can't provide a link but I can tell you how my setup differs from your example files.

1 - jQuery was included with jQuery.noConflict(); (because Magento uses Prototype.js)
2 - All JavaScript files were included in the head of the HTML document (I'm guessing this is the problem?) as apposed to the bottom of the HTML document.

<reference name="head">
    <action method="addJs">
        <file>ontic/core/library/jquery.min.js</file>
    </action>
    <action method="addJs">
        <file>ontic/core/library/jquery.noconflict.js</file>
    </action>
    <action method="addJs">
        <file>ontic/core/library/snap.svg.min.js</file>
    </action>
    <action method="addJs">
        <file>ontic/core/library/pizza.js</file>
    </action>
</reference>

Hope this helps, let me know if this gets resolved,

Regards,
Adam

@mrsweaters
Copy link
Contributor

Thank you for this, I'll test this out today.

@ontic
Copy link
Author

ontic commented May 6, 2014

Were you able to reproduce/fix this problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant