Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Save to My Library
Look up keyword or section
Like this
7Activity
0 of .
Results for:
No results containing your search query
P. 1
JQuery HowTo

JQuery HowTo

Ratings: (0)|Views: 576 |Likes:
Published by kzelda
JQuery HowTo
JQuery HowTo

More info:

Published by: kzelda on Jan 20, 2011
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF, TXT or read online from Scribd
See more
See less

11/12/2011

pdf

text

original

 
FRIDAY, OCTOBER 15, 2010
Check if a language file is loaded for jQueryGlobalization plugin
Recently, I wrote my first jQuery Globalization pluginintroductory post. Imentioned that I will write a tutorial for Globalization plugin and I am. Whilewriting the tutorial I thought I’ll write one of my short Friday jQuery tips.In this post you will learn how to check if a specific jQuery Globalization pluginlanguage file is loaded or not. Globalization plugin saves localization data and allinformation in
jQuery.cultures
object. By default English language is added.So if you add "Inuktitut" language (code
iu
) the
jQuery.cultures
object will beextended and will have
jQuery.cultures.iu
object in it.So to check if particular language file is loaded all we need to do is to check if 
jQuery.cultures.langCode
is defined. Here is an example:
if
($.cultures.iu){  
// Inuktitut jquery.glob.iu.js lang file is loaded 
}
else
 { 
// Inuktitut language is not loaded, load it here 
}
Some cultures have different alphabet, so they will have that appended in their language and culture names. For example Inuktitut has Syllabics (
iu-Cans
) andLatin alphabets (
iu-Latn
), So you will not be able to check the file existencewith the code above. Here is a syntax to do it:
if
($.cultures.iu-
Latin
){ 
// Will not work 
}
// Better way to check if the lang file is loaded 
if
($.cultures["iu-Latn"]){  
// Inuktitut jquery.glob.iu-Latn.js lang file is loaded 
}
else
 { 
// Inuktitut language is not loaded, load it here 
}
WEDNESDAY, OCTOBER 6, 2010
JavaScript to detect iPad visitors
This post gives you a short JavaScript function to detect your iPad users.Without any further ado, a javascript code to detect iPad users:
function
isiPad(){ 
return
 (navigator.platform.indexOf("iPad") != -1); }
You can also detect browser version and some other stuff by parsing user agentstring. Here is an
iPad Safari’s user agent string
for your reference:
 Mozilla
/5.0 (iPad;U;CPU OS3_2like
 Mac
OS X;en-us) 
 AppleWebKit
/531.21.10 (KHTML,like
Gecko
) 
 Version
/4.0.4 
 Mobile
/7B334b 
Safari
/531.21.10
Recently a friend of mine got himself an iPad and I couldn’t not notice how hisinternet browsing device preferences are changing (PC & iPad). More and morepeople are using hand held devices namely iPad to browse the internet. So it’sabout time to show your iPad visitors some love and display your websitedesigned specifically for iPad.
JQUERY HOWTO
BLOG IS ABOUT JQUERY JAVASCRIPT LIBRARY. I COLLECT JAVASCRIPT CODE SNIPPETS, HOWTO'S, TIPS ANDPERFORMANCE OBSERVATIONS.POSTED BY UZBEKJON AT1:23 PM 0 COMMENTS LABELS:BEGINNER,JQUERY,PLUGIN,REFERENCE,TIP,TUTORIAL
20/01/2011 JQuery HowTohttp://jquery-howto.blogspot.com/ 1/73
 
Let’s see how to do this. There are two way:1. Redirect iPad visitors2. Apply different CSS file for iPad usersMost of the posts on the internet related to iPad user detection are suggestingand showing you how to redirect (including myself in my previousiPhone & iPoddetectionpost). However, I would recommend the second option, applyingdifferent CSS file.You can apply the same technique described inapplying different styling for  javascript enabled browser with CSSpost and apply different CSS rules for iPadvisitors.
Sidenote:
If you decide to redirect iPad users rather than apply different CSSstyle rules, than I would recommend using server side detection and redirection.You can see an example PHP code byDavid Walsh.
TUESDAY, OCTOBER 5, 2010
 jQuery Globalization plugin — jquery.glob.js
This is the first post of a series that are dedicated to jQuery’s new Microsoftcontributed Globalization plugin or shortly
jquery.glob.js
. In this first post I willtry to cover the very basics like library licensing, “the good & the bad” and somethoughts on how it could be improved (IMO).
I will be post some jQuery globalization plugin tutorials in coming days, so bare with me.
Before we jump intolicensingandsupportissues, first things are first.
What’sup with the name?
It’s confusing! When did we start calling localization (l10n) aglobalization?! I haven’t seen any g12n abbreviations lately, have you? When Ifirst came across it, I thought it was some wicked jQuery solution to "globalvariables are evil" idea or solution to some other problem that I am not evenfamiliar with :) Don’t you agree, it’s confusing a bit.
So, there you go. One little improvement: "Don’t confuse, rename it!" 
Before we talk about the jQuery globalization plugin license, let me mention thatthis plugin is now
officially supported by jQuery Project
. Which means that itwill be under continues improvement by jQuery core team and will be compatiblewith the future jQuery and jQuery UI releases. Also globalization plugin willbecome a part of the jQuery UI project.
 jQuery Project officially supports jQuery Globalization plugin.
Now, the legal stuff – the license. Because jQuery project accepted theglobalization plugin as officially supported (and of course because Microsoftagreed to its terms) jQuery Globalization plugin is distributed under 
the samelicense as core jQuery.js
. So you are safe to do pretty much anything.
 jQuery Globalization plugin is licensed under the same non-restrictive terms as the core jQuery.js 
After playing with the plugin for a while I realized that it does not do any DOMmanipulations and you certainly don’t expect any animations. So
what’s thepoint of having it as jQuery plugin
and not a general JavaScriptglobalization/localization library? This way a larger community could benefit fromit. I guess it was more of marketing decision rather than technical.
JavaScript library alternative to globalization plugin would be nice.
To be honest, JavaScript and jQuery community had a lack of localizationlibraries and jQuery Globalization plugin with over 350 localizations is a greatsolution. Surely, plugin’s exposed function names and namespacing could beimproved, and most probably will be, but we’ll talk about it in our next “jQueryGlobalization plugin tutorial” post. Stay tuned…
SATURDAY, SEPTEMBER 25, 2010POSTED BY UZBEKJON AT1:15 PM 0 COMMENTS LABELS:CSS,HOWTO,JAVASCRIPT,JQUERY,JQUERY MOBILE,REFERENCE,TIP POSTED BY UZBEKJON AT3:17 PM 0 COMMENTS LABELS:INSIGHTS,JQUERY,JQUERY UI,NEWS,PLUGIN
20/01/2011 JQuery HowTohttp://jquery-howto.blogspot.com/ 2/73
 
Russian CDN for jQuery
I recently discovered that the biggest Russian search engine Yandex (yeah, it’sbigger than Google in Russia) is using jQuery on its home page. It also hosts allprevious jQuery versions on it’s fast gzip enabled servers just likeGoogleandMIcrosoftdo.Because most of the Russian internet users have visited Yandex already, theyalready have it in their browser cache. I also did route tracing from Russian server to Google CDN servers and I was directed to the server in California, USA andpining the local Russian CDN server was at least 3 times faster.Anyway, if you decide to use Russian CDN to host your jQuery files here are thelinks:
 Minified versions
http://yandex.st/jquery/1.2.6/jquery.min.jshttp://yandex.st/jquery/1.3.0/jquery.min.jshttp://yandex.st/jquery/1.3.1/jquery.min.jshttp://yandex.st/jquery/1.3.2/jquery.min.jshttp://yandex.st/jquery/1.4.0/jquery.min.jshttp://yandex.st/jquery/1.4.1/jquery.min.jshttp://yandex.st/jquery/1.4.2/jquery.min.js
 Non minified versions
http://yandex.st/jquery/1.2.6/jquery.jshttp://yandex.st/jquery/1.3.0/jquery.jshttp://yandex.st/jquery/1.3.1/jquery.jshttp://yandex.st/jquery/1.3.2/jquery.jshttp://yandex.st/jquery/1.4.0/jquery.jshttp://yandex.st/jquery/1.4.1/jquery.jshttp://yandex.st/jquery/1.4.2/jquery.js
 jQuery UI links
http://yandex.st/jquery-ui/1.8.2/jquery-ui.min.js
Hosted versions
1.8.2, 1.8.1, 1.8.0, 1.7.3, 1.7.2, 1.7.1, 1.7.0, 1.6.0
jQuery UI modules can be downloaded seperately
http://yandex.st/jquery-ui/1.7.2/effects.blind.jshttp://yandex.st/jquery-ui/1.8.0/jquery.effects.blind.min.js
Language files
http://yandex.st/jquery-ui/1.7.2/i18n/ui.datepicker-ru.jshttp://yandex.st/jquery-ui/1.8.0/i18n/jquery.ui.datepicker-ru.min.js
jQuery UI CSS files (matches original directory names)
http://yandex.st/jquery-ui/1.8.0/themes/humanity/jquery.ui.all.min.css
FRIDAY, SEPTEMBER 24, 2010
iPhone / iPod detection using jQuery &JavaScript
In this post you will learn how todetect iPhone/iPodusing javascript/jQuery,redirect your iPhone usersto mobile version of your site using javascript andalternative and better way to redirect your visitors usingserver-side PHP codesnippet.The latest buzz around jQuery is upcoming jQuery mobile– support for mobiledevices. Current jQuery core work fine on iPhone and iPod touch browsers andmost of us have created a mobile version of our websites, developed or convertedwebsites for others. Basically, jQuery is already being used on iPhone and iPodtouch devices. Without any further ado…
POSTED BY UZBEKJON AT10:19 AM 2 COMMENTS LABELS:JQUERY,LINK,PERFORMANCE,RESOURCE
20/01/2011 JQuery HowTohttp://jquery-howto.blogspot.com/ 3/73

Activity (7)

You've already reviewed this. Edit your review.
1 hundred reads
1 thousand reads
Hanse69 liked this
Hanse69 liked this
cinar_coskun liked this
ALi liked this
ALi liked this

You're Reading a Free Preview

Download
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->