Code Simplified – Viral Sarvaiya

Code Simplified – Viral Sarvaiya, Web Developer Friends, dot net Developer, Sql Server Developer

Archive for the ‘Jquery’ Category

Using Jquery detect mobile

Posted by Viral Sarvaiya on October 22, 2013


Toay i get good script of jQuery that detect mobile.

It require to Jquery file – http://code.jquery.com/jquery-1.8.3.js

Here code is.

$(document).ready(function () {
  var isMobile = {
    Android: function () {
      return navigator.userAgent.match(/Android/i) ? true : false;
    },
    BlackBerry: function () {
      return navigator.userAgent.match(/BlackBerry/i) ? true : false;
    },
    iOS: function () {
      eturn navigator.userAgent.match(/iPhone|iPad|iPod/i) ? true : false;
    },
    Windows: function () {
      return navigator.userAgent.match(/IEMobile/i) ? true : false;
    },
    any: function () {
      return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Windows());
    }
  };
  alert(isMobile.any())
});

Hope it helps you.

Thanks.

Posted in Javascript, Jquery | Tagged: , , , , | Leave a Comment »

Export to Excel using jQuery

Posted by Viral Sarvaiya on October 21, 2013


From my past posts explains how to export to excel as
1. Export GridView Data into CSVFile In Asp.net
2. GridView Export to Excel

So here its 3rd type to export to excel using Jquery.

In javascript, we have window.open function. We are using same function to export to excel using jquery.

Syntax,

window.open(MIMEtype,replace);

Here
MIMEtype : this is the optional parameter, and its for type of document. default it take as “text/html”
replace : this is also optional parameter, and its set.

Example,

$("#btn_Export").click(function(e) {
window.open('data:application/vnd.ms-excel,' + $('#divData').html());
e.preventDefault();
});

Hope its helps you.

Thanks.

Posted in .Net, ASP.NET, Javascript, Jquery | Tagged: , , , , , | Leave a Comment »

Use of Cookies in jQuery

Posted by Viral Sarvaiya on September 27, 2013


I have already writen that how to use cookies in asp.net and silverlight from below post
https://codesimplified.com/2009/09/10/how-to-createreaddelete-cookies-in-asp-net/
and
https://codesimplified.com/2010/08/27/cookies-in-silverlight/

here i am posting new post that shows how to use cookies in Jquery

Create cookie:

$.cookie('myCookie', 'CookieValue', { expires: 7, path: '/' });

Read cookie:

$.cookie('myCookie'); // => "CookieValue"

Read all available cookies:

$.cookie(); // => { "myCookie": "CookieValue", "...remaining": "cookies" }

Delete cookie:

// Returns true when cookie was found, false when no cookie was found...
$.removeCookie('myCookie');

// Same path as when the cookie was written...
$.removeCookie('myCookie', { path: '/' });

Thanks.

Posted in .Net, ASP.NET, Javascript, Jquery | Tagged: , , , , , | Leave a Comment »

jQuery Tutorials Examples

Posted by Viral Sarvaiya on September 10, 2009


jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. jQuery is designed to change the way that you write JavaScript
So we have selected a set of best tutorials that will strengthen your practical side using jQuery .
Click here to read more…..

50 useful new jquery  techniques

create an amazing music player using mouse gestures hotkeys in jquery

creating a virtual jquery keyboard

Posted in Jquery | Tagged: , | Leave a Comment »

 
%d bloggers like this: