I\'ve been sifting around the web trying to find out whats going on here and I have not been able to get a concrete answer.
I have one $(document).ready
You might consider to use
window.onload
instead of
$(document).ready
It happened to me also, but I realized that the script had been included twice because of a bad merge.
try putting this in your functions.js to prevent it from being executed twice :
var checkit = window.check_var;
if(checkit === undefined){ //file never entered. the global var was not set.
window.check_var = 1;
}
else {
//your functions.js content
}
however i suggest that you look more into it to see where are you calling the second time.
I had a similar problem when I was trying to refresh a partial. I called a return ActionResult instead of a return PartialViewResult. The ActionResult caused my ready() to run twice.
I had this problem with window.load function was executed twice: The reason was because I had reference to the same javascript-file in the main page as well as a .net usercontrol. When I removed the reference in the main page, the load-function was only executed once.
In my case $(document).ready was firing twice because of bad CSS, check if any part of your CSS has background-image: url('');