I want to use RequireJs in my project, but I found that I can't write the following code
<html>
<head>
</head>
<body>
<input type="button" />
<script>
// Use the jQuery
$(function() {
//some code
}
)
</script>
<input />
<input />
// I had added the jQuery in required shim and jQuery is working in RequireJs.
<script data-main="scripts/main" src="/scripts/require.js"></script>
</body>
</html>
There was an error $ is undefined
, when the page was loaded.
I looked up a lot articles, but I can't solve it. How can I handle this? I don't want to move the sample js function to .js file.