@NO1nam

Как получить значение из table и отправить его через post?

<div id="cc-tabs">
<ul class="nav nav-pills nav-justified" role="tablist" style="border: 1px solid rgba(255,255,255,0.23) ;">
<li class="nav-item" role="presentation"><a class="nav-link active" role="tab" data-toggle="pill" href="#tab-1">Status<p id="statusData" class="dataNums">0%</p></a></li>
<li class="nav-item" role="presentation"><a class="nav-link" role="tab" data-toggle="pill" href="#tab-2">Valid/Unused<p id="validData" class="dataNums">0</p></a></li>
<li class="nav-item" role="presentation"><a class="nav-link" role="tab" data-toggle="pill" href="#tab-3">Used/Inactive<p id="inactiveData" class="dataNums">0</p></a></li>
<li class="nav-item" role="presentation"><a class="nav-link" role="tab" data-toggle="pill" href="#tab-4">Invalid/Error<p id="errorData" class="dataNums">0</p></a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active cc-tab-div" role="tabpanel" id="tab-1">
<div class="row">
<div class="col">
<div class="statusGroup" style="margin-top: 0;"><span class="statusInput">Check Queue:</span><span id="ccs-queue" class="statusInput">0/0</span></div>
<div class="statusGroup"><span class="statusInput">Remaining:</span><span id="ccs-remaining" class="statusInput">0</span></div>
<div class="statusGroup"><span class="statusInput">Current Set:</span><span id="ccs-currentset" class="statusInput">null</span></div>
<div class="statusGroup" style="margin-bottom: 15px;"><span class="statusInput">Estimated Time Left:</span><span id="ccs-timeremaining" class="statusInput">0s</span></div>
</div>
<div class="col">
<div class="card bg-dark text-center" style="background: rgba(52,58,64,0.4) !important;border-style: solid;border-color: rgb(181,181,181);">
<div class="card-body" style="padding-top: 5px;padding-bottom: 5px;-webkit-user-select: none;-moz-user-select: none;-ms-user-select: none;-o-user-select: none;user-select: none;">
<h6 class="card-title" style="margin-bottom: 6px;"><i class="icon ion-android-settings" style="margin-right: 5px;"></i>SETTINGS</h6>
<div class="col">
<div class="custom-control custom-switch" style="margin-bottom: 8px;"><input class="custom-control-input" type="checkbox" id="blurCodes" style="display: none;" onclick="blurCodes(this);"><label class="custom-control-label" for="blurCodes">Blur Valid Codes<i class="fa fa-question-circle" data-toggle="tooltip" data-bs-tooltip="" data-placement="right" title="" style="margin-left: 10px;" data-original-title="This option will blur all valid codes. This is especially useful for when you want to take a screenshot of some sort."></i></label></div>
<div class="custom-control custom-switch" style="margin-bottom: 8px;"><input class="custom-control-input" type="checkbox" id="replaceDuplicates" style="display: none;"><label class="custom-control-label" for="replaceDuplicates">Replace Duplicates<i class="fa fa-question-circle" data-toggle="tooltip" data-bs-tooltip="" data-placement="right" title="" style="margin-left: 10px;" data-original-title="This option will replace a duplicated code on the tables, if it is re-checked again. For example, if the code is checked while valid, then it is used and checked again, the checker will delete it from the valid table."></i></label></div>
</div>
<div class="col" style="margin-top: 10px;">
<p class="d-inline-flex" style="padding-left: 3px;padding-right: 3px;">Threads:</p>
<div class="btn-group btn-group-sm threads-group" role="group" style="padding-left: 3px;padding-right: 3px;"><button class="btn btn-dark" type="button" title="Slow Internet Connection" value="1">1x</button><button class="btn btn-dark" type="button" title="Normal Internet Connection" value="2" style="background-color: #23272b !important;border-color: #1d2124 !important;">2x</button>
<button class="btn btn-dark" type="button" title="Fast Internet Connection" value="3">3x</button>
</div><i class="fa fa-question-circle" data-toggle="tooltip" data-bs-tooltip="" data-placement="right" style="margin-left: 10px;" title="" data-original-title="The higher the threads -> the faster the checker is. However, if your internet speed is slow, increasing this option may slow down the checker or return errors instead."></i></div>
</div>
</div>
</div>
</div>
<div class="progress" style="margin-top: 15px;height: 25px;">
<div class="progress-bar bg-dark progress-bar-striped" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" id="cc-progress" style="transition: 0.5s;width: 100%;"><span class="sr-only">100%</span></div>
</div>
</div>
<div class="tab-pane cc-tab-div" role="tabpanel" id="tab-2">
<div class="table-responsive table-bordered cc-table">
<table class="table table-bordered table-hover table-dark table-sm table-sort" id="cc-table-valid">
<thead>
<tr>
<th role="columnheader">Code<i class="fas fa-sort-alpha-up float-right tableSortIcon"></i></th>
<th role="columnheader">Status<i class="fas fa-sort-alpha-up float-right tableSortIcon"></i></th>
<th role="columnheader">Title<i class="fas fa-sort-alpha-up float-right tableSortIcon"></i></th>
<th role="columnheader">Description<i class="fas fa-sort-alpha-up float-right tableSortIcon"></i></th>
<th role="columnheader">EntitlementName<i class="fas fa-sort-alpha-up float-right tableSortIcon"></i></th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
</div>
<div class="tab-pane cc-tab-div" role="tabpanel" id="tab-3">
<div class="table-responsive table-bordered cc-table">
<table class="table table-bordered table-hover table-dark table-sm table-sort" id="cc-table-inactive">
<thead>
<tr>
<th role="columnheader">Code<i class="fas fa-sort-alpha-up float-right tableSortIcon"></i></th>
<th role="columnheader">Status<i class="fas fa-sort-alpha-up float-right tableSortIcon"></i></th>
<th role="columnheader">Title<i class="fas fa-sort-alpha-up float-right tableSortIcon"></i></th>
<th role="columnheader">Description<i class="fas fa-sort-alpha-up float-right tableSortIcon"></i></th>
<th role="columnheader">EntitlementName<i class="fas fa-sort-alpha-up float-right tableSortIcon"></i></th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
</div>
<div class="tab-pane cc-tab-div" role="tabpanel" id="tab-4">
<div class="table-responsive table-bordered cc-table">
<table class="table table-bordered table-hover table-dark table-sm table-sort" id="cc-table-error">
<thead>
<tr>
<th role="columnheader">Code<i class="fas fa-sort-alpha-up float-right tableSortIcon"></i></th>
<th role="columnheader">Status<i class="fas fa-sort-alpha-up float-right tableSortIcon"></i></th>
<th role="columnheader">Message<i class="fas fa-sort-alpha-up float-right tableSortIcon"></i></th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
</div>
</div>
</div>

Нужно получить Code из #tab-2 и отправить post запрос с этим кодом через jquery
P.s каждый раз когда появится новый код что бы его отправил
  • Вопрос задан
  • 48 просмотров
Пригласить эксперта
Ответы на вопрос 1
@zkrvndm
Боты, парсеры, расширения
Отправить данные из этой ячейки на сервер можно вот так:
$.ajax({
	url: 'https://адрес_куда_надо_отправить',
	method: 'POST',
	cache: false,
	data: { 'code' :  $('#tab-2 th').eq(0).text() },
	dataType: 'html',
	success: function(html){
		alert('Ответ сервера: ' + html);
	},
	error: function(obj) {
		alert('Ошибка отправки!');
	}
});
Ответ написан
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы