I'm building a site using ASP.NET MVC, and I have partial views that use jQuery to do various things. I was thinking of switching to Google's AJAX API and using their loader to load jQuery. However, I noticed that I would no longer be able to use $(document).ready()
anymore because Google's loader specifies a callback google.setOnLoadCallback()
.
This is a little bit of a problem for me because I have $(document).ready()
in various partial views because they do different things specific to themselves that I don't want the parent view to be aware of.
Can I specify multiple callbacks and just swap out the $(document).ready()
's with google.setOnLoadCallback(someUniqueCallbackFunction)
?
Would that be the ideal way to handle this situation or is there something else that is preferred?