$(document).ready(function(){
$("a[rel^='prettyPhoto']").prettyPhoto();
});
$(document).ready(function(){
randomtip();
}); But I am not sure about this, may be someone can comment while I am searching about it? Try changing the jquery first.$(document).ready(function(){
$("a[rel^='prettyPhoto']").prettyPhoto();
randomtip();
}); BTW, you call the randomtip() twice, but I don't think this that cause the error It looks like you're new here. If you want to get involved, click one of these buttons!