{"id":16760350,"url":"https://github.com/ryanve/oi","last_synced_at":"2025-03-16T09:16:40.768Z","repository":{"id":4648145,"uuid":"5793398","full_name":"ryanve/oi","owner":"ryanve","description":"cross-browser DOM ready module","archived":false,"fork":false,"pushed_at":"2013-10-31T09:08:08.000Z","size":260,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-15T21:51:22.814Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/oi","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ryanve.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-09-13T10:56:01.000Z","updated_at":"2023-08-08T21:08:56.000Z","dependencies_parsed_at":"2022-08-06T17:16:33.896Z","dependency_job_id":null,"html_url":"https://github.com/ryanve/oi","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanve%2Foi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanve%2Foi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanve%2Foi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanve%2Foi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ryanve","download_url":"https://codeload.github.com/ryanve/oi/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243847056,"owners_count":20357317,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T04:23:13.388Z","updated_at":"2025-03-16T09:16:40.743Z","avatar_url":"https://github.com/ryanve.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [oi](../../)\n#### cross-browser DOM ready module\n\n```sh\n$ npm install oi\n```\n\n### Usage\n\nFire a function when the DOM is ready:\n\n```js\noi.domReady(function (oi) {\n\t// `this === document` in here\n});\n```\n\nSimple cross-browser event methods:\n\n```js\noi.addEvent(elem, eventName, handler);\noi.removeEvent(elem, eventName, handler);\n```\n\n### Integration\n\n**oi** has a special method called `.bridge()` designed for integration. Integrated methods include the top-level `.domReady`/`.addEvent`/`.removeEvent` methods. If the `receiver` has an `.fn` object, it will also receive `.fn.ready`. Note that `oi.domReady` and `oi.fn.ready` are identical. The latter is provided purely for integration purposes.\n\n```js\noi.bridge(receiver) // integrate `oi`'s public methods into `receiver` (won't overwrite existing props)\noi.bridge(receiver, true) // integrate `oi`'s public methods into `receiver` (overwrites existing props)\n```\n\nThe default behavior of the `oi.bridge()` makes it so that the `receiver` becomes the first arg passed to fns, like so:\n\n```js\nreceiver.domReady(function (receiver) {\n\t// `this === document` in here\n});\n```\n\njQuery-compatible receivers also get `.fn.ready`:\n\n```js\nreceiver(document).ready(function (receiver) {\n\t// `this === document` in here\n});\n```\n\nThe `.domReady` (and `.fn.ready`) methods both contain both a `.remix()` method that can be used for freeform integration. Use this if you want to create a new version of the ready function which sends multiple custom args. The `.remix()` method returns a new version of itself:\n\n```js\nreceiver.domReady = oi.domReady.remix(customArg0, customArg1 /*, ...*/);\n```\n\nSee advanced [#integration notes in the source](oi.js).\n\n## [MIT License](http://opensource.org/licenses/MIT)\n\nCopyright (C) 2012 by [Ryan Van Etten](https://github.com/ryanve)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryanve%2Foi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fryanve%2Foi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryanve%2Foi/lists"}