search

Home  >  Q&A  >  body text

javascript - A problem with requireJs introducing jquery

    <script>
        require(['js/math','js/jquery'],function(math,$){
            $('body').append('<p>5566</p>')
            alert(math.add(1,1))
        })
    </script>

All js codes are as above,
Two ways to write, one is to write require.config
The other is as above, but write the report like this $ is not a function,
My problem is that jq directly causes Is the path OK?

某草草某草草2764 days ago456

reply all(1)I'll reply

  • 迷茫

    迷茫2017-06-12 09:32:34

    I see there is nothing wrong with this code, maybe there is something wrong with require.config

    reply
    0
  • Cancelreply