Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
jquery-load-json
Advanced tools
jQuery plugin that enables developers to load JSON data from the server and load JSON object into the DOM.
#jQuery loadJSON plugin This is a jQuery plugin that enables developers to load JSON data from the server and load JSON object into the DOM. No templating language is required - this plugin matches DOM elements in the HTML page with a JSON object using a DOM element properties.
##Community Want to contribute to jQuery loadJSON? Awesome! See CONTRIBUTING for more information.
###Code of Conduct Please note that this project is released with a Contributor Code of Conduct to ensure that this project is a welcoming place for everyone to contribute to. By participating in this project you agree to abide by its terms.
##Requirements Requires jQuery 1.7+.
##Download
###CDN
<script src="https://cdn.rawgit.com/kevindb/jquery-load-json/v1.3.3/dist/jquery.loadJSON.min.js" integrity="sha384-fG4z44FEBJnIevyzvSDobSmVTsO/oVsxNvKcUl7bO1ihWYDPg2QI83Xi+7wSBzap" crossorigin="anonymous"></script>
##Usage To use loadJSON plugin two items should be defined:
###HTML template Template is plain HTML code. Only requirement is that elements that should be populated must have id, name, class, or rel attributes that have matching properties in the JSON object. Example of HTML template is shown below:
<div id="data">
<h1 id="Name"></h1>
<label for="Address">Address:</label>
<span id="Address"></span>
<label for="Contact">Contact by:</label>
<span id="Contact"></span>
</div>
In the template h1 tag with id Name, and span tags with ids Address and Contact will be populated with JSON properties.
###JSON object Once HTML template is defined JSON object that will be used to populate template must be defines. Example of object that can populate template shown above is shown in the following listing:
data = {
"Name":"Emkay Entertainments",
"Address":"Nobel House, Regent Centre",
"Contact":"Phone"
}
Object has three properties (Name, Address, and Contact) that will be injected into the template.
###Binding JSON object to the template Once HTML template and JSON object are defined, JSON object can be loaded into the HTML code. This can be achieved using the following line of JavaScript code:
$('div#data').loadJSON(data);
As a result 'data' object will be loaded into the HTML fragment with id data. Resulting HTML is shown in the following listing:
<div id="data">
<h1 id="Name">Emkay Entertainments</h1>
<label for="Address">Address:</label>
<span id="Address">Nobel House, Regent Centre</span>
<label for="Contact">Contact by:</label>
<span id="Contact">Phone</span>
</div>
You can find detailed instructions how the plugin can be used in the following pages:
##Examples You can see few live examples where it is shown how loadJSON plugin can be used:
##Contributors This project has had several previous homes. See CONTRIBUTORS for details.
##License
This repository is licensed under the GNU Lesser General Public License v2.1.
See LICENSE for details.
FAQs
jQuery plugin that enables developers to load JSON data from the server and load JSON object into the DOM.
The npm package jquery-load-json receives a total of 0 weekly downloads. As such, jquery-load-json popularity was classified as not popular.
We found that jquery-load-json demonstrated a not healthy version release cadence and project activity because the last version was released 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.