scripts/routes/pjax.js
function _isValid(el, currentPath) {
	// Link has no destination URL
	if (! el.href) { return false; }

	// Link opens a new browser window
	if (el.target === '_blank') { return false; }

	// Link is not absolute URL
	if (! /https?:/.test(el.href)) { return false; }

	// Link is a download
	if (el.hasAttribute('download')) { return false; }

	// Link is supposed to be ignored
	if (el.hasAttribute('data-static')) { return false; }

	// Link is external URL
	if (el.host && el.host !== location.host) { return false; }

	// Link is current page, but with a hash added
	if (el.hash && el.pathname === currentPath) { return false; }

	return true;
}
function _isValid(el, currentPath) {
	// Link has no destination URL
	if (! el.href) { return false; }

	// Link opens a new browser window
	if (el.target === '_blank') { return false; }

	// Link is not absolute URL
	if (! /https?:/.test(el.href)) { return false; }

	// Link is a download
	if (el.hasAttribute('download')) { return false; }

	// Link is supposed to be ignored
	if (el.hasAttribute('data-static')) { return false; }

	// Link is external URL
	if (el.host && el.host !== location.host) { return false; }

	// Link is current page, but with a hash added
	if (el.hash && el.pathname === currentPath) { return false; }

	return true;
}
function _isValid ( el , currentPath ) { // Link has no destination URL if ( ! el . href ) { return false ; } // Link opens a new browser window if ( el . target === '_blank' ) { return false ; } // Link is not absolute URL if ( ! / https?: / . test ( el . href ) ) { return false ; } // Link is a download if ( el . hasAttribute ( 'download' ) ) { return false ; } // Link is supposed to be ignored if ( el . hasAttribute ( 'data-static' ) ) { return false ; } // Link is external URL if ( el . host && el . host !== location . host ) { return false ; } // Link is current page, but with a hash added if ( el . hash && el . pathname === currentPath ) { return false ; } return true ; }
Determine if path is valid for history navigation

@param {HTMLElement} el
@param {string} [currentPath]
@returns {boolean}
@private
Determine if path is valid for history navigation