Search code examples
javascriptjqueryzurb-foundationzepto

Uncaught SyntaxError: Unexpected token ? using Zepto


I'm using Zurb Foundation and am getting the following error

Uncaught SyntaxError: Unexpected token ?

From this block of code:

<script>
    document.write('<script src=http://[mydomain]/js/vendor/'
    + ('__proto__' in  ? 'zepto' : 'jquery')
    + '.js><\/script>');
</script>

The code appears to be in accordance with Zurb's documentation. Is this error something to be concerned about? If so, what could I do to resolve the error?


Solution

  • You are missing a variable in the below line:

    + ('__proto__' in  ? 'zepto' : 'jquery')
    

    Should have been something like below:

    + ('__proto__' in myObject ? 'zepto' : 'jquery')