Skip to main content

Posts

Showing posts from March, 2009

Use different CSS rules / styles in JavaScript or jQuery enabled browsers

This is a simple yet very useful and powerful technique. Using different CSS rules in JavaScript or jQuery enabled browsers lets you customize your website style for JS enabled and disabled browsers using only CSS. Thus you separate concerns of styling and business logic into CSS and javascript. This lets you concentrate on your goals and not styling in your javascript code for example. All you

Use different CSS rules / styles in JavaScript or jQuery enabled browsers

This is a simple yet very useful and powerful technique. Using different CSS rules in JavaScript or jQuery enabled browsers lets you customize your website style for JS enabled and disabled browsers using only CSS. Thus you separate concerns of styling and business logic into CSS and javascript. This lets you concentrate on your goals and not styling in your javascript code for example. All you

“jQuery HowTo” on Twitter

Lately there is a lot of buzz about Twitter. It seems everybody is on Twitter, twittering… So I started investigation what all that buzz was about and what I could have done with it. Several days later I found myself twittering. Twitter is a great place to build your community of interest. For example if you are interested in jQuery than you can follow people who share tweets about jQuery/

“jQuery HowTo” on Twitter

Lately there is a lot of buzz about Twitter. It seems everybody is on Twitter, twittering… So I started investigation what all that buzz was about and what I could have done with it. Several days later I found myself twittering. Twitter is a great place to build your community of interest. For example if you are interested in jQuery than you can follow people who share tweets about jQuery/

Check if jQuery plugin is loaded

The previous post checked if jQuery is loaded, now it is time to check if particular jQuery plugin is loaded. Checking if plugin exists or if plugin has been already loaded is useful if you are writing your jQuery code that depends on that plugin. Here is how to check if some jQuery plugin is loaded or not: if(jQuery().pluginMethod) { //jQuery plugin exists } else { //jQuery plugin DOES

Check if jQuery plugin is loaded

The previous post checked if jQuery is loaded, now it is time to check if particular jQuery plugin is loaded. Checking if plugin exists or if plugin has been already loaded is useful if you are writing your jQuery code that depends on that plugin. Here is how to check if some jQuery plugin is loaded or not: if(jQuery().pluginMethod) { //jQuery plugin exists } else { //jQuery plugin DOES

Adding and using jQuery on Blogger / Blogspot

Investigating my visitors statistics, I noticed that there were some users who were interested in adding and using jQuery on their Blogger.com (Blogspot.com) accounts. Adding jQuery library to your Blogger/Blogspot blog is not difficult. All you have to do is to add one line of code to your template’s header. Here is the code to add to your blogger template’s header: <script src="http://

Adding and using jQuery on Blogger / Blogspot

Investigating my visitors statistics, I noticed that there were some users who were interested in adding and using jQuery on their Blogger.com (Blogspot.com) accounts. Adding jQuery library to your Blogger/Blogspot blog is not difficult. All you have to do is to add one line of code to your template’s header. Here is the code to add to your blogger template’s header: <script src="http://

Check if jQuery.js is loaded

This is the very basics of any programming language, checking if some class, method, variable or property does already exist. In our case the programming environment is JavaScript and the object we are checking for existence is jQuery() / $() function. This method is not limited to jQuery only, you can check for any other variable or function in your javascript. Anyway, jQuery() or $()

Check if jQuery.js is loaded

This is the very basics of any programming language, checking if some class, method, variable or property does already exist. In our case the programming environment is JavaScript and the object we are checking for existence is jQuery() / $() function. This method is not limited to jQuery only, you can check for any other variable or function in your javascript. Anyway, jQuery() or $()

Dynamically creating input box/checkbox/radio button... does not work in Internet Explorer (IE)

While working on some project, trying to create a checkbox and radio button dynamically using jQuery I came across a problem. Mozilla Firefox, Opera and Safari were creating and rendering my new checkboxes just fine, but Internet Explorer (IE6, IE7) did not create them. I spend half a day trying to figure out what is wrong with my jQuery or JavaScript code. Some hours later, I remember, I came

Dynamically creating input box/checkbox/radio button... does not work in Internet Explorer (IE)

While working on some project, trying to create a checkbox and radio button dynamically using jQuery I came across a problem. Mozilla Firefox, Opera and Safari were creating and rendering my new checkboxes just fine, but Internet Explorer (IE6, IE7) did not create them. I spend half a day trying to figure out what is wrong with my jQuery or JavaScript code. Some hours later, I remember, I came

jQuery UI 1.7.1 released

The first maintenance release for jQuery UI 1.7 has been released. You can download jQuery UI 1.7.1 from the following links: Uncompressed: http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/jquery-ui.js Compressed: http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/jquery-ui.min.js

jQuery UI 1.7.1 released

The first maintenance release for jQuery UI 1.7 has been released. You can download jQuery UI 1.7.1 from the following links: Uncompressed: http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/jquery-ui.js Compressed: http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/jquery-ui.min.js

Only the last element is bound/inserted/etc. in your javascript code’s “for” loop

There is a common problem when you use javascript for loop to bind an event function or add a class that comes from looping selection’s attributes. To make clear what I mean consider this example: var lis = $('ul li'); for (var i = 0; i var id = lis[i].id; lis[i].onclick = function () { alert(id); }; } // All li's get and alert the last li's id There is

Only the last element is bound/inserted/etc. in your javascript code’s “for” loop

There is a common problem when you use javascript for loop to bind an event function or add a class that comes from looping selection’s attributes. To make clear what I mean consider this example: var lis = $('ul li'); for (var i = 0; i var id = lis[i].id; lis[i].onclick = function () { alert(id); }; } // All li's get and alert the last li's id There is

Convert javascript objects into arrays for better performance

jQuery Howto blog has many posts on your javascript  and jQuery code performance. If you have read the last performance post named “5 easy tips on how to improve code performance with huge data sets in jQuery” then you probably got an idea that it’s better to work with arrays for better javascript performance. The only problem is that jQuery returns an object not an array when you select

Convert javascript objects into arrays for better performance

jQuery Howto blog has many posts on your javascript  and jQuery code performance. If you have read the last performance post named “5 easy tips on how to improve code performance with huge data sets in jQuery” then you probably got an idea that it’s better to work with arrays for better javascript performance. The only problem is that jQuery returns an object not an array when you select