{"id":15769760,"url":"https://github.com/mrcgrtz/jquery-externalize","last_synced_at":"2025-12-12T04:25:11.704Z","repository":{"id":36951523,"uuid":"2044643","full_name":"mrcgrtz/jquery-externalize","owner":"mrcgrtz","description":"Externalize is a JavaScript solution (read: jQuery plugin) which unobtrusively adds external window creation to a bunch of links.","archived":false,"fork":false,"pushed_at":"2025-04-02T04:26:27.000Z","size":1547,"stargazers_count":11,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-25T18:08:57.870Z","etag":null,"topics":["jquery","jquery-plugin","links","target-blank","window"],"latest_commit_sha":null,"homepage":"http://plugins.jquery.com/externalize/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mrcgrtz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2011-07-13T22:34:10.000Z","updated_at":"2025-04-02T04:26:30.000Z","dependencies_parsed_at":"2023-02-12T22:46:03.293Z","dependency_job_id":"8ff13ef5-1389-44f4-8a09-8a030244f556","html_url":"https://github.com/mrcgrtz/jquery-externalize","commit_stats":{"total_commits":207,"total_committers":7,"mean_commits":"29.571428571428573","dds":0.3526570048309179,"last_synced_commit":"8c5f903cf56056ceef0b72c679ad8c09c9af09ca"},"previous_names":["dreamseer/jquery-externalize"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrcgrtz%2Fjquery-externalize","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrcgrtz%2Fjquery-externalize/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrcgrtz%2Fjquery-externalize/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrcgrtz%2Fjquery-externalize/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrcgrtz","download_url":"https://codeload.github.com/mrcgrtz/jquery-externalize/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251812536,"owners_count":21647924,"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":["jquery","jquery-plugin","links","target-blank","window"],"created_at":"2024-10-04T14:05:41.500Z","updated_at":"2025-12-12T04:25:11.667Z","avatar_url":"https://github.com/mrcgrtz.png","language":"JavaScript","readme":"# Externalize\n\n\u003e Externalize is a jQuery plugin which unobtrusively adds external window creation to a bunch of links. It’s ridiculously small (\u003c 1kB g’zipped).\n\n[![Test](https://github.com/mrcgrtz/jquery-externalize/actions/workflows/test.yml/badge.svg)](https://github.com/mrcgrtz/jquery-externalize/actions/workflows/test.yml)\n[![Coverage Status](https://coveralls.io/repos/github/mrcgrtz/jquery-externalize/badge.svg?branch=main)](https://coveralls.io/github/mrcgrtz/jquery-externalize?branch=main)\n[![MIT license](https://img.shields.io/github/license/mrcgrtz/jquery-externalize.svg)](https://github.com/mrcgrtz/jquery-externalize/blob/main/LICENSE.md)\n\n## Why?\n\nIn the past I used XHTML 1.0 Strict which prohibited the `target` attribute. Whenever I had a client who wanted to open some links in a new window, I told them this, and I really did not want to switch to ugly Transitional doctypes. But most of the time they insisted on new windows, so I created a solution written in JavaScript which eventually became the one in this repository.\n\nNow everybody uses HTML5 which is fine. You may go and use `target` again.\n\nI for myself use this as a _playground_ for writing and maintaining jQuery plugins. :-)\n\n## Install\n\nUsing [npm](https://www.npmjs.com/get-npm):\n\n```bash\nnpm install jquery-externalize\n```\n\nUsing [yarn](https://yarnpkg.com/):\n\n```bash\nyarn add jquery-externalize\n```\n\n## Usage\n\nExternalize is chainable and highly customizable (well, as customizable as it can get by now) by using these options:\n\n* `name`, sets the external window’s name (string, default: `\"external\"`)\n* `target`, determines wether to use the `target` HTML attribute to support Firefox’s tab handling and Safari’s status bar info or not (boolean, default: `true`)\n* `classes`, applies CSS classes to an external link (string, default: `\"\"`)\n* `relation`, applies a relationship to an external link (string, default: `\"external\"`)\n* `title`, sets the text added as or appended to the `title` attribute to inform the user about an upcoming new window (string, default: `\"Opens in a new window\"`)\n\n## Examples\n\nThe most common use case would be:\n\n```html\n\u003cp\u003e\u003ca href=\"https://example.com/\" title=\"example.com\"\u003eGo to example site\u003c/a\u003e\n\n\u003cscript src=\"http://code.jquery.com/jquery-3.6.0.slim.min.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"jquery.externalize.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n$('a[href*=\"//\"]').externalize();\n\u003c/script\u003e\n```\n\nAs a result we get a link that makes use of HTML5’s `external` relationship attribute and which features a descriptive `title` attribute in English and a plain old `target` attribute to open up a new window:\n\n```html\n\u003cp\u003e\u003ca href=\"https://example.com/\" rel=\"external\" title=\"example.com (Opens in a new window)\" target=\"external\"\u003eGo to example site\u003c/a\u003e\u003c/p\u003e\n```\n\nAnother use case: Opening PDF files in a new window.\n\n```html\n\u003cp\u003e\u003ca href=\"/download/sample.pdf\"\u003eDownload PDF\u003c/a\u003e\n\n\u003cscript src=\"http://code.jquery.com/jquery-3.6.0.slim.min.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"jquery.externalize.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n$('a[href$=\".pdf\"]').externalize({\n  target: false\n});\n\u003c/script\u003e\n```\n\nThis becomes a link with an `onClick` event to open a new window:\n\n```html\n\u003cp\u003e\u003ca href=\"/download/sample.pdf\" rel=\"external\" title=\"Opens in a new window\"\u003eDownload PDF\u003c/a\u003e\u003c/p\u003e\n```\n\n## License\n\nMIT © [Marc Görtz](https://marcgoertz.de/)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrcgrtz%2Fjquery-externalize","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrcgrtz%2Fjquery-externalize","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrcgrtz%2Fjquery-externalize/lists"}