{"id":19043715,"url":"https://github.com/cogizmo/sajax-content","last_synced_at":"2026-04-17T13:31:51.225Z","repository":{"id":57103327,"uuid":"167502000","full_name":"cogizmo/sajax-content","owner":"cogizmo","description":"Custom Element that transcludes a document (in whole or part) into the current document at its current location.","archived":false,"fork":false,"pushed_at":"2019-02-06T13:43:30.000Z","size":89,"stargazers_count":0,"open_issues_count":6,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-12T13:03:10.000Z","etag":null,"topics":["ajax","custom-element","native-web-component","segmented-ajax","transclude-html","web-component"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cogizmo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-01-25T07:09:45.000Z","updated_at":"2019-02-08T21:36:46.000Z","dependencies_parsed_at":"2022-08-20T23:20:53.389Z","dependency_job_id":null,"html_url":"https://github.com/cogizmo/sajax-content","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/cogizmo/sajax-content","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cogizmo%2Fsajax-content","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cogizmo%2Fsajax-content/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cogizmo%2Fsajax-content/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cogizmo%2Fsajax-content/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cogizmo","download_url":"https://codeload.github.com/cogizmo/sajax-content/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cogizmo%2Fsajax-content/sbom","scorecard":{"id":298708,"data":{"date":"2025-08-11","repo":{"name":"github.com/cogizmo/sajax-content","commit":"84384ea40690b82c1caee9141c678b45173df324"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":0,"reason":"Found 0/6 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: ISC License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"13 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-6c8f-qphg-qjgp","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-fhjf-83wg-r2j9","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-4g88-fppr-53pp","Warn: Project is vulnerable to: GHSA-4jqc-8m5r-9rpr","Warn: Project is vulnerable to: GHSA-7p7h-4mm5-852v","Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-17T20:10:19.398Z","repository_id":57103327,"created_at":"2025-08-17T20:10:19.398Z","updated_at":"2025-08-17T20:10:19.398Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31931273,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-17T12:37:54.787Z","status":"ssl_error","status_checked_at":"2026-04-17T12:37:25.095Z","response_time":62,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["ajax","custom-element","native-web-component","segmented-ajax","transclude-html","web-component"],"created_at":"2024-11-08T22:42:58.584Z","updated_at":"2026-04-17T13:31:51.205Z","avatar_url":"https://github.com/cogizmo.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `\u003csajax-content\u003e`\nTranscludes HTML content from an external HTML resource.\n\n## Usage\n\nFetch the HTML document and replace itself with the HTML body contents.\n```html\n\u003csajax-content src=\"path/to/external.html\" auto\u003e\u003c/sajax-content\u003e\n```\n\n## Installation\n\n`\u003csajax-content\u003e` is available on [NPM](https://www.npmjs.com/package/@cogizmo/sajax-content) and may be installed as  a dependency.\n\n```\n\u003e npm install @cogizmo/sajax-content\n```\n\n1. Place the files on your server.\n\n2. Install the appropriate [cogizmo/Cogizmo](https://github.com/cogizmo/cogizmo).\n    * From npm\n    ```\n    \u003e npm install @cogizmo/cogizmo\n    ```\n\n    * From github\n\n3. Add Cogizmo to your document `\u003chead\u003e`.\n\n    ```html\n    \u003cscript src=\"path/to/Cogizmo.js\"\u003e\u003c/script\u003e\n    ```\n\n4. Add `\u003csajax-content\u003e` element to your document.\n\n    ```html\n    \u003cscript src=\"path/to/sajax-content.js\"\u003e\u003c/script\u003e\n    ```\n\n6. Use element whereever you want to transclude html.\n\n    ```html\n    \u003csajax-content src=\"path/to/external.html\"\u003e\u003c/sajax-content\u003e\n    ```\n\n## Declarative API (HTML)\n\n### `auto` attribute\n\n`Boolean`\n\nWhen true, will fetch the external HTML when a valid [src attribute](#src-attribute). When false, will wait until [`auto` attribute](#auto-attribute) is true or [transclude](#transclude()) is called.\n\n`True`:\n```html\n\u003csajax-content auto\u003e\u003c/sajax-content\u003e\n```\n\n`False`:\n```html\n\u003csajax-content\u003e\u003c/sajax-content\u003e\n```\n\n### `select` attribute\n\n`String\u003cCSSSelector\u003e` = `\"*\"`\n\nDetermines which elements are transcluded from the external HTML document's `\u003cbody\u003e`. Valid values are any selector that can be used as an argument for `HTMLElement.querySelectorAll()`. The following gets all `\u003cp\u003e`s that are children of elements with `class=\"container\"`.\n\n```html\n\u003csajax-content select=\".container \u003e p\"\u003e\u003c/sajax-content\u003e\n```\n\n### `src` attribute\n\n`String` - *Required*\n\nURL pointing to the desired external HTML document. URLs are calculated in relation to the current document.\n\n```html\n\u003csajax-content src=\"path/to/external.html\"\u003e\u003c/sajax-content\u003e\n```\n\n## Imperative API (JS/ES)\n\n### `element.auto`\n\nReturns `Boolean` - *ReadOnly*\n\nWhen true, will fetch the external HTML when a valid [src attribute](#src-attribute). When false, will wait until [`auto` attribute](#auto-attribute) is true or [transclude](#transclude()) is called.\n\n### `element.select`\n\nReturns `String\u003cCSSSelector\u003e` = `\"*\"`\n\nDetermines which elements are transcluded from the external HTML document's `\u003cbody\u003e`. Valid values are any selector that can be used as an argument for `HTMLElement.querySelectorAll()`. The following gets all `\u003cp\u003e`s that are children of elements with `class=\"container\"`.\n\n### `element.src`\n\nReturns `String` - *ReadOnly*\n\nURL pointing to the desired external HTML document. URLs are calculated in relation to the current document.\n\n### `element.transclude()`\n\nGets an external HTML document from [`src` attribute](), queries the document for the elements using the [`select` attribute](#select), and imports them into the current HTML document.\n\n## DOM Events\n\n`\u003csajax-content\u003e` events try to behave as close to native DOM as possible. This means that you may cancel `\u003csajax-content\u003e`s default behavior without having to worry about order of listeners or hierarchy. There is a single limitation to maintain defaultable and cancelable behavior. do not add an event listener to `\u003csajax-content\u003e` events on the `window/global` object.\n\n### response\n\nFires when `transclude()` has retrieved a URL successfully.\n\nDetail: The [`response` object](https://developer.mozilla.org/en-US/docs/Web/API/Response) containing the data retrieved by the URL.\n\n### sajax-success\n\nFires when the transclusion process has successfully retrieved elements from an HTML document.\n\nDetail: The `NodeList` query results from the external HTML document. *The nodes are not yet imported.*\n\n### sajax-import\n\nFires when the transclusion process has imported the `NodeList` results.\n\nDetail: An `Array` containing the imported nodes.\n\n### sajax-attach\n\nFires when the transclusion process has attached the imported nodes from the external HTML document.\n\nDetail: An `Array` containing the attached nodes.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcogizmo%2Fsajax-content","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcogizmo%2Fsajax-content","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcogizmo%2Fsajax-content/lists"}