Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
dynamicloaderjs
Advanced tools
DynamicLoaderJS is a lightweight JavaScript library that enables dynamic loading of content into web pages without page refresh. It provides a simple and flexible way to update specific sections of a website, such as the main content area, header, or foot
DynamicLoaderJS is a lightweight JavaScript library that enables dynamic loading of content into web pages without page refresh. It provides a simple and flexible way to update specific sections of a website, such as the main content area, header, or footer, without reloading the entire page.
Run the autoload function after every function happened, because js can't target the new rendered html. So, that nesting of elements can happen. (Optional)
DynamicLoader.autoLoad();
You can include DynamicLoaderJS in your project by downloading the DynamicLoader.js file and including it in your HTML file:
<script src="path/to/DynamicLoader.js"></script>
Alternatively, you can use a CDN by including the following script tag in your HTML file:
<script src="https://cdn.jsdelivr.net/gh/SH20RAJ/DynamicLoaderJS@main/DynamicLoader.js"></script>
data-load
attribute to the HTML element where you want to load the content. Set the value of data-load
to the URL of the content you want to load.<div data-load="page1.html" data-target="#content"></div>
data-load
attribute specifies the URL of the content to be loaded.data-target
attribute specifies the selector of the target element where the content will be loaded.data-loader
attribute to show a loader during content loading. Set data-loader
to "true" to enable the loader.data-title
to change the document title after click.<div data-load="page1.html" data-target="#content" data-loader="true" data-title="Page1"></div>
data-load
attribute to the respective HTML element and specify the target selector using the data-target
attribute.<header data-load="header.html" ></header>
<footer data-load="footer.html" ></footer>
loadFile
function with the URL of the file and the file type as parameters.DynamicLoader.loadFile('https://cdn.example.com/styles.css', 'css');
DynamicLoader.loadFile('https://cdn.example.com/script.js', 'js');
DynamicLoader.load()
and passing the selector, URL, and optional loader element.DynamicLoader.load('#op', 'page3.html');
This will load the content from page3.html
into the element with the selector #op
.
For detailed usage examples, please refer to the Examples directory in this repository.
Contributions are welcome! If you have any ideas, suggestions, or bug reports, please create an issue or submit a pull request.
This project is licensed under the MIT License.
Created with ❤️ by SH20RAJ
FAQs
DynamicLoaderJS is a lightweight JavaScript library that enables dynamic loading of content into web pages without page refresh. It provides a simple and flexible way to update specific sections of a website, such as the main content area, header, or foot
The npm package dynamicloaderjs receives a total of 4 weekly downloads. As such, dynamicloaderjs popularity was classified as not popular.
We found that dynamicloaderjs demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.