Skip to content

Instantly share code, notes, and snippets.

Created March 2, 2012 12:52
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
(function (w) {
// Define two queues for handlers
w.readyQ = [];
w.bindReadyQ = [];
// Define the fake jQuery function to capture handlers
w.$ = w.jQuery = function (handler) {
// Push a handler into the correct queue
function pushToQ(x, y) {
if (x == "ready") {
} else {
if (handler === document || handler === undefined) {
// Queue $(document).ready(handler), $().ready(handler)
// and $(document).bind("ready", handler) by returning
// an object with alias methods for pushToQ
return {
ready: pushToQ,
bind: pushToQ
} else {
// Queue $(handler)
Copy link

mepawan commented Jan 23, 2019


I read your article :

and implemented this in our site. Its working in chrome and firefox, IE but its not working in safari.

any clue how I can make this work on safari as well?


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment