ajaxでhtmlを取得
-
ajaxを使用し、テーマフォルダに入っているHTMLファイルを取得して表示したいのですができません。
script.js
$(function() { $('.about').click(function() { $.ajax({ type: 'GET', url: 'test.html', dataType: 'html', success: function(data) { $('.ajaxget').append(data); }, error:function(XMLHttpRequest, textStatus, errorThrown) { alert('問題がありました。'); console.log("XMLHttpRequest : " + XMLHttpRequest.status); console.log("textStatus : " + textStatus); console.log("errorThrown : " + errorThrown.message); } }); }); });
上記記述で、404エラーが帰ってきます。
パスの記述方法が間違っているのでしょうか?WordPress,Ajax共に無知で大変申し訳ございませんが、
お力お貸しいただければ幸いです。よろしくお願いいたします。
2件の返信を表示中 - 1 - 2件目 (全2件中)
2件の返信を表示中 - 1 - 2件目 (全2件中)
- トピック「ajaxでhtmlを取得」には新たに返信することはできません。