Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
723 B
16
Indexable
Never
const sent_urls = () => {
	const formData = new FormData();
	formData.append('action', 'start_parsing');
	formData.append('of_start_parsing_nonce', of_start_parsing_nonce.value);
	formData.append('urls', urls.slice(offset, offset + limit));

	formData.append( 'category_fans', category_fans );  

	fetch(ajaxurl, {
		method: 'POST',
		body: formData
	}).then(response => {
		if (!response.ok) {
			throw new Error('Network response was not ok');
		}
		return response.json();
	}).then(data => {
		if (data.error) {
			throw new Error(data.error);
		}

		if (!data.result) {
			throw new Error('Unknown error');
		}

		return;

		} else {
			sent_urls();
		}
	}).catch(error => {
		enable();
		alert.show_warn(error);
	});
}
Leave a Comment