function canonical_uri(src,base_path) {
		var absolute_regex = /^\w+\:\/\//;

		// is `src` is protocol-relative (begins with // or ///), prepend protocol
		if (/^\/\/\/?/.test(src)) {
			src = location.protocol + src;
		}
		// is `src` page-relative? (not an absolute URL, and not a domain-relative path, beginning with /)
		else if (!absolute_regex.test(src) && src.charAt(0) != "/") {
			// prepend `base_path`, if any
			src = (base_path || "") + src;
		}
		// make sure to return `src` as absolute
		return absolute_regex.test(src) ? src : ((src.charAt(0) == "/" ? root_domain : root_page) + src);
	}
function canonical_uri(src,base_path) {
		var absolute_regex = /^\w+\:\/\

		
		if (/^\/\/\/?/.test(src)) {
			src = location.protocol + src;
		}
		
		else if (!absolute_regex.test(src) && src.charAt(0) != "/") {
			
			src = (base_path || "") + src;
		}
		
		return absolute_regex.test(src) ? src : ((src.charAt(0) == "/" ? root_domain : root_page) + src);
	}
function canonical_uri ( src , base_path ) { var absolute_regex = / ^\w+\:\/\/ / ; // is `src` is protocol-relative (begins with // or ///), prepend protocol if ( / ^\/\/\/? / . test ( src ) ) { src = location . protocol + src ; } // is `src` page-relative? (not an absolute URL, and not a domain-relative path, beginning with /) else if ( ! absolute_regex . test ( src ) && src . charAt ( 0 ) != "/" ) { // prepend `base_path`, if any src = ( base_path || "" ) + src ; } // make sure to return `src` as absolute return absolute_regex . test ( src ) ? src : ( ( src . charAt ( 0 ) == "/" ? root_domain : root_page ) + src ) ; }
make script URL absolute/canonical
make script URL absolute / canonical