Ajax 응답에 문제가 있습니다.
내 .php 파일은 테이블을 생성합니다
<div class="result">
<tr class="distr">
<td><input name="somename" value="value"></input</td>
<td>..more input</td>
...more <tds>
</tr>
<div>
.js 파일
//...unrelated code up here
$.ajax({
type: "POST",
url: "myphpfile.php",
data: "data that creates table",
success: function(r) {
var getdata = $(r).filter(".result");
console.log(getdat);
}
});
내 주요 파일에는
<table class="tbl">
<tr>
<td><input></input></td>
...
</tr>
</table>
내 PHP 파일에 의해 생성 된 테이블을 추가하려고합니다.
<table class="tbl">
하지만 내가받는 반응은
<input>...</input>
<input>...</input>
some other div children here
<input>...</input>
some text
모든 것 대신
<div class="result">
누군가 이것이 어떻게 작동하는지 설명해 줄 수 있습니까? 또한 .filter () 대신 .find ( ". result")를 시도했습니다. 아 그리고 그 div가 반환되는 것을 원하지 않습니다. 그 안에있는 테이블 만 반환됩니다.
이해하기 어려운 경우 죄송합니다. 입력 할 때이 모든 것이 이상해 보입니다.
감사
당신의 교체 div
로모그래퍼 table
가 적절한 HTML 수 있도록.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다