0

Could anyone say why the below line is creating issue in My Magento 1 Web Store ?

<script type="text/javascript" src="https://cdn.jsdelivr.net/jquery/3.1.1/jquery.min.js"></script>

I am getting following errors

Uncaught TypeError: element.attachEvent is not a function(…)
Uncaught TypeError: jQuery(...).superfish is not a function(…)
Uncaught TypeError: element.dispatchEvent is not a function(…)
Failed to load resource: net::ERR_CONNECTION_RESET
Uncaught TypeError: jQuery(...).prepare_slider is not a function(…)
1
  • You need to be more specific and provide actual error or log output. Commented Nov 11, 2016 at 13:54

1 Answer 1

1

It looks like two separate issues are occurring: the line Failed to load resource... leads be to believe that you're having problems with your internet connection, or that the script delivery service is having an issue. It's also obvious from the errors you added that jQuery is not being included properly on your page, so you should solve the issues and ensure that it's downloaded.

Also, depending on where you're including the file on your page, you may be attempting to use jQuery before it's been included, which would definitely cause the issues you're referring to. Make sure what you're including it in the <head> tag.

6
  • Thanks @tjons for your nice reply. I would like to know which are possible areas to include js files in Magento 1 ?
    – abu abu
    Commented Nov 11, 2016 at 15:15
  • Layout XML has support for it in the head tag, and this question (magento.stackexchange.com/questions/355/…) may give you some pointers on including it in the footer. Technically, you can include it anywhere - any .phtml template will take and output <script> tags.
    – tjons
    Commented Nov 11, 2016 at 15:20
  • @abuabu if the answer helped, please upvote and consider accepting! Thanks.
    – tjons
    Commented Nov 11, 2016 at 15:20
  • I upvote and consider accepting all those answers which are solved my issues.
    – abu abu
    Commented Nov 11, 2016 at 15:34
  • @abuabu Did my answer solve the problem?
    – tjons
    Commented Dec 7, 2016 at 2:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.