Showing posts with label Javascript. Show all posts
C# Code to implement Google Analytics Tracking Script dynamically
In general we track a page using JavaScript statically. This C# code is used to implement Google Analytics Tracking Script dynamically for every page we want to do it.
Source Code:
using System;
using System.Collections.Generic;
using System.Configuration;
using.
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>
.
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.
How to get current HTML Page Title/URL with jQuery/Javascript?
Get current HTML page Title and URL with jQuery and Javascript.
Current Page Title:
jQuery:
var title = $(document).find("title").text();
(or)
var title = $('title').text();
(or)
var title = $(document).attr('title');
Javascript:
var title.