javascriptmobilewindows-phonemicrosoft-edgelumia

Lumia 640 LTE edge explorer - javascript $ is not defined


We've developed a responsive website for mobile phones. But we've encountered a problem with the mobile phone Lumia 640 LTE.

The Edge explorer on this device doesn't load properly the JavaScript and returns the error "$ is not defined".

It brokes always on "script type="text/javascript"" section and the next line is for example "$('#search')".

It doesn't supports jQuery?


Solution

  • I assume that you have already tried to test your website in other browsers and it worked. If it is so, the possible reason can be one of the next:

    1. Edge treats $ like impossible name for the variable. In this case try to replace it with jQuery as Jawahar recommended in comment.

    2. Make sure that you connect jQuery script before you use it in your script part. If you connect jQuery via <script> tag, be sure that it is before your own script.