ajax が not found になる
Uncaught TypeError: $.ajax is not a function
って表示された対策です。
Uncaught TypeError: $.ajax is not a function
jqueryを呼び出しているのに、見つからないってエラーが表示されます。
ソースはこんな感じ。。
$.ajax({ type: 'POST', url : '/api/get_medical_info', data: { "medial_name" : form.hospitalName.value }, success: function( data ) { console.dir( data ); }, error: function() { console.log( "Error" ); }});
jqueryのslim版が犯人!!
bootstrapを使っていたので、jqueryのslim版を読み込んでいたんですが、どうやらそれが原因でした。
<script src="https://code.jquery.com/jquery-3.4.1.slim.js" integrity="sha256-BTlTdQO9/fascB1drekrDVkaKd9PkwBymMlHOiG+qLI=" crossorigin="anonymous"></script>
slim版でなくて、通常版を読み込むことが必要です。
<script src="https://code.jquery.com/jquery-3.4.1.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
bootstrapへの影響は???
今のところ無いです。
たぶん無いはずです(^^;
