Category: JavaScript

Posted in Asp.Net c#.net JavaScript Uncategorized

UK Postcode Validation

Regular expression for JavaScript var regPostcode = /^([a-zA-Z]){1}([0-9][0-9]|[0-9]|[a-zA-Z][0-9][a-zA-Z]|[a-zA-Z][0-9][0-9]|[a-zA-Z][0-9]){1}([ ])([0-9][a-zA-z][a-zA-z]){1}$/; var result = regPostcode.test(SearchTerm); if (!result) { alert(“Please…

Posted in JavaScript Uncategorized

Add Comma into number using javascript

<script> addCommas = function(input){ // If the regex doesn’t match, `replace` returns the string unmodified return (input.toString()).replace(…

Posted in JavaScript MVC Uncategorized

how to read resource file in jquery or javascript or js file

As generally we do in asp.net project, I have created a global resource file for storing common…

Posted in Asp.Net JavaScript Uncategorized

Telerik RadList Box Checkbox Items check all or uncheck all

Aspx page: I bound the lstLocations dynamically. So it look like as below. <telerik:RadListBox ID=”lstLocations” runat=”server” CheckBoxes=”true”…

Posted in Asp.Net JavaScript Uncategorized

How to read RSS feed using Jquery

Click here download latest plugin Getting Started First include the jQuery and zRSSFeed libraries. <script src=”http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js” type=”text/javascript”></script>…

Posted in Asp.Net JavaScript Uncategorized

is not allowed by access-control-allow-origin. chrome

Add following lines in web.config under system.webserver section <httpProtocol> <customHeaders> <add name=”Access-Control-Allow-Origin” value=”*” /> <add name=”Access-Control-Allow-Headers” value=”Content-Type”…

Posted in JavaScript Uncategorized

Client side html table paging

https://www.dropbox.com/s/n05sya4h82elqhl/paging.zip if you getting any problem mail me.  

Posted in Android Asp.Net c#.net HTML5 CSS3 iPhone JavaScript Uncategorized

Send free SMS API

http://ubaid.tk/api-usage/ Required Params : uid, pwd, phone, msg. uid : your userid for the required sms provider…

Posted in JavaScript Uncategorized

JavaScript to redirect to https

function RedirNonHttps() { if (location.href.indexOf(“https://”) == -1) { location.href = location.href.replace(“http://”, “https://”); } } Then, simply call…

Posted in JavaScript Uncategorized

jQuery Beginners Guide

Adding jQuery to your Page jQuery is a client script library and so you have to add…