我想问我是否可以将以下 JavaScript 代码合并到一个文件中?
当我输入一个 file.js
$(document).ready(function(){$('#slider-with-blocks-1').royalSlider({arrowsNav:true,arrowsNavAutoHide:false,fadeinLoadedSlide:false,controlNavigationSpacing:0,controlNavigation:'bullets',imageScaleMode:'none',imageAlignCenter:false,blockLoop:true,loop:true,numImagesToPreload:6,transitionType:'fade',keyboardNavEnabled:true,block:{delay:400} }) });
和
$(document).ready(function(){
$('.credit ').append(' credit by <span></span>');
$('.credit span')
.html($('<a/>').attr('href','www.google.com')
.text('This is my link to google!')
);
$('.credit span a')
.attr('id', 'credit');
});
和
$("[role='navigation']").flexNav();
和
window.onload = function() {
if (!document.getElementById('credit') || document.getElementById('credit').href != "http://www.google.com/") {
alert('Kreditnya jangan diilangin sob!');
}
};