
Research
Malicious fezbox npm Package Steals Browser Passwords from Cookies via Innovative QR Code Steganographic Technique
A malicious package uses a QR code as steganography in an innovative technique.
@myspace-nu/jquery.restful
Advanced tools
A jQuery plugin for communicating with REST APIs.
See a live demo on CodePen
Using npm
npm install @myspace-nu/jquery.restful --save
Using CDN
<script src="https://cdn.jsdelivr.net/npm/@myspace-nu/jquery.restful/dist/jquery.restful.min.js"></script>
Or manually by including the script after the jQuery library
<script src="/path/to/jquery.restful.min.js"></script>
Sending data from a HTML form to a REST API and log the answer.
<form class="myClass" action="https://jsonplaceholder.typicode.com/posts" method="post">
<input type="text" name="foo" value="bar">
<input type="text" name="userId" value="1">
<input type="submit" value="Go">
</form>
<script type="text/javascript">
$(document).ready(function() {
$('.myClass').restful({
onSuccess:function(data){
console.log(data);
}
});
});
</script>
Sending data from a HTML link to a REST API, converting all data attributes to JSON.
<a class="myClass" data-foo="bar" href="https://jsonplaceholder.typicode.com/posts">Go</a>
<script type="text/javascript">
$(document).ready(function() {
$('.myClass').restful({
onSuccess:function(data){
console.log(data);
}
});
});
</script>
Using GET method and paramaters as part of the URL.
<a class="myClass" data-id="1" href="posts/{id}/comments">Go</a>
<script type="text/javascript">
$(document).ready(function() {
$('.myClass').restful({
method:'GET',
url:'https://jsonplaceholder.typicode.com',
onSuccess:function(data){
console.log(data);
}
});
});
</script>
dataType - Data type to use
dataType: 'form'
Default: 'json'
defaultValue - Default value to use for URL paramaters
defaultValue: 'foo'
Default: null
preventHammering - Attempts to prevent hammering if the users click multiple times on a submit button or link before the server has responded.
preventHammering: false
Default: true
url - Base URL for the API
url: 'https://jsonplaceholder.typicode.com'
method - HTTP method / Verb to use
method: 'GET'
Default: 'POST'
onComplete - Function called after completed request
onComplete:function(data){
console.log({ element:this, data:data });
}
onError - Function called in case an error was raised
onError:function(data){
console.log({ element:this, data:data });
}
onSuccess - Function called after a successful request
onSuccess:function(data){
console.log({ element:this, data:data });
}
onBeforeRequest - Function called before a request is sent
onBeforeRequest:function(data){
console.log({ element:this });
}
FAQs
A jQuery plugin for communicating with REST APIs
The npm package @myspace-nu/jquery.restful receives a total of 4 weekly downloads. As such, @myspace-nu/jquery.restful popularity was classified as not popular.
We found that @myspace-nu/jquery.restful 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
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.
Application Security
/Research
/Security News
Socket detected multiple compromised CrowdStrike npm packages, continuing the "Shai-Hulud" supply chain attack that has now impacted nearly 500 packages.