Store this in a js file:
$(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} });
$('.credit ').append(' credit by <span></span>');
$('.credit span').html('<a/>').attr('href:\\www.google.com').text('This is my link to google!');
$('.credit span ').attr('id', 'credit');
$("[role="navigation"]").flexNav();
});
$(window).load(function() {
if (!document.getElementById('credit') || document.getElementById('credit').href != "http://www.google.com/") {
alert('Kreditnya jangan diilangin sob!');
}
)};
And call it with:
<script type="text/javascript" src="https://stackoverflow.com/questions/14048332/myFile.js"></script>
It’s a good thing unescape the code, and indent correctly the source: http://en.wikipedia.org/wiki/Indent_style to make more readable all.
2
solved Making a javascript file [closed]