###問題
electronでjquery uiを使おうとおもってやってみると
jquery is not defind とでました。普通にchromeなどのブラウザでやってみると正常に動いたので、おそらくelectron特有の何かが関係しているのだとおもいます。この場合、どのように記述すればいいのでしょうか?
###現在のソースコード
divを掴んでドラッグするプログラムなのですが、electronでは全く動かず、jquery is not defindとでました。
<!DOCTYPE html> <html lang="ja" > <head> <meta charset="utf-8"> <link rel="stylesheet" href="frame/jquery-ui.css"> <script type="text/javascript" src="frame/jquery-3.1.1.min.js"></script> <script type="text/javascript" src="frame/jquery-ui.js"></script> <script>window.$ = window.jQuery = require('jquery');</script> <script> </script> <style> *{ margin:0; padding:0; outline:none; box-sizing:border-box; font-family:"游明朝"; } .body{ box-shadow:0 0 0 1px rgb(74, 74, 74) inset; border-radius:5px; width:100vw; height:100vh; background:white; } .a{ width:80px; height:80px; background:green; } </style> </head> <body> <div class="body"> <div class="a"></div> </div> <script> $(function(){$(".a").draggable();
});
</script> </body> </html>回答1件
あなたの回答
tips
プレビュー