# metasync/2.6.13/views/js/metasync-bing-console.js

Search Atlas SEO – OTTO AI SEO Automation for WordPress, version 2.6.13. 70 lines.

- Page: https://pluginprobe.com/plugins/metasync/2.6.13/code/views/js/metasync-bing-console.js
- Raw: https://pluginprobe.com/plugins/metasync/2.6.13/raw/views/js/metasync-bing-console.js
- Modified: 2026-06-15T23:43:24+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/metasync/2.6.13/code/views/js/metasync-bing-console.js#L10-L20`.

```javascript
/* global jQuery, ajaxurl, metasyncBingConsoleData */
/**
 * MetaSync Bing IndexNow console.
 *
 * Extracted from views/metasync-bing-console.php (Phase 5, #887).
 */
jQuery(document).ready(function ($) {
	$('#metasync-bing-response').hide();

	$('#metasync-bing-btn-send').on('click', function () {
		const $button = $(this);
		const $url = $('#metasync-bing-url');
		const $response = $('#metasync-bing-response');
		const originalText = $button.html();

		// Validate URLs
		if (!$url.val().trim()) {
			alert('Please enter at least one URL to submit.');
			return;
		}

		// Disable button and show loading state
		$button.html('🔄 Submitting...').prop('disabled', true);

		// Make AJAX request
		jQuery.ajax({
			method: 'POST',
			url: ajaxurl,
			data: {
				action: 'metasync_send_bing_indexnow',
				nonce: metasyncBingConsoleData.nonce,
				metasync_bing_url: $url.val()
			}
		})
			.done(function (response) {
				$response.show();

				// Parse response
				const urls = $url.val().split('\n').filter(Boolean);
				const urlsDisplay = urls.length > 1 ? urls.length + ' URLs submitted' : urls[0];

				$('.result-urls').empty().append($('<strong>').text('Submitted:')).append(document.createTextNode(' ' + urlsDisplay));

				if (response.success) {
					$('.result-status-code').text('✅ Success').css('color', '#4caf50');
					$('.result-message').text(response.message || 'URLs successfully submitted to IndexNow.');
				} else {
					$('.result-status-code').text('❌ Error').css('color', '#f44336');
					$('.result-message').text(response.message || 'Failed to submit URLs. Please check your API key configuration.');
				}

				// Show response details if available
				if (response.response_code) {
					var $msg = $('.result-message');
					$msg.text($msg.text() + ' Response Code: ' + response.response_code);
				}
			})
			.fail(function (xhr, status, error) {
				$response.show();
				$('.result-urls').empty().append($('<strong>').text('Error'));
				$('.result-status-code').text('❌ Request Failed').css('color', '#f44336');
				$('.result-message').text('Network error: ' + error);
			})
			.always(function () {
				// Re-enable button
				$button.html(originalText).prop('disabled', false);
			});
	});
});

```
