How to load AddThis dynamically with ajax?
On page load there is no issues with AddThis widget. But when the 'Share' button is binding via ajax, then the AddThis functionality will not work. To fix this solution, use the following script.
<script type="text/javascript"> .
How to Add Active Navigation Class Based on URL?
Ideally you output this class from the server side, but if you can't...
Let's say you have navigation like this:
HTML:
<nav>
<ul>
<li><a href="/">Home</a></li>
.
How to enable paste option in Windows Server 2008 to copy from local machine?
Restart rdpclip.exe in Server machin.
jQuery to load first 5 elements & click "load more" to display next 5 elements
jQuery functionality to load first 5 elements & click "load more" to display next 5 elements.
HTML:
<ul id="myList">
<li>One</li>
<li>Two</li>
<li>Three</li>
.
How to get the class name using jQuery?
Consider the following HTML:
<div id="myId" class="myclass"></div>
jQuery:
var className = $('.myclass').attr('class');
(or)
var className = $('#myId').attr('class');
Reference: StackOverflow.c.
Working with jQuery ajax error function
By using the $.ajaxSetup() we can handle the error/exception as mentioned below:
$(function() {
$.ajaxSetup({
error: function(jqXHR, exception) {
.
List of built-in functions in Javascript
.src td {
padding:4px;
}
The following are the list of pre-defined/built-in functions in Javascript.
Number Methods
The Number object contains only the default methods that are part of every object's definition.
MethodDescription
constructor()Returns.