<script>
$(window).load(function() {
if(navigator.userAgent.match(/(iPad)/)){
	$('#about_gentei').css({'cssText': 'background-attachment: local !important;'});
}
});
</script>
<script>
$(document).ready(function(){
//PC環境の場合
if (window.matchMedia( '(min-width: 769px)' ).matches) { //切り替える画面サイズ
$.ajax({
url: 'js/pc.js',
dataType: 'script',
cache: false
});
//モバイル環境の場合
} else {
$.ajax({
url: 'js/sp.js',
dataType: 'script',
cache: false
});
};
});
</script>
上記と、()の数が違う。検証必要

<script>
$(document).ready(function(){
var ua = navigator.userAgent;
if (ua.indexOf('iPhone') > 0 || ua.indexOf('Android') > 0 && ua.indexOf('Mobile') > 0) {
        // スマートフォン用コード
} else if (ua.indexOf('iPad') > 0 || ua.indexOf('Android') > 0) {
        // タブレット用コード
} else {
        // PC用コード
}
})
</script>
<script>
if (navigator.userAgent.indexOf('iPhone') > 0 || navigator.userAgent.indexOf('iPad') > 0 || navigator.userAgent.indexOf('iPod') > 0 || navigator.userAgent.indexOf('Android') > 0) {
	$(document).ready(function() {
	$('#KEYVISUAL').append('<video autoplay playsinline loop muted><source src="../img/this_site_only/youtube/key.wemb" type="video/webm"><source src="../img/this_site_only/youtube/key.mp4" type="video/mp4"></video>');
});
}else{
	$(document).ready(function() {
    $('#KEYVISUAL').append('<video autoplay loop muted preload="metadata"><source src="../img/this_site_only/youtube/key.mp4" type="video/mp4"><source src="../img/this_site_only/youtube/key.webm" type="video/webm"></video>');
});
}
</script>