Showing posts with label My Tutorials | Web. Show all posts
Showing posts with label My Tutorials | Web. Show all posts

How to write jQuery code before loading it?

jQuery and various other JS source files are regular part of website built nowadays. But this is always suggested to load JS files at the end of the document. In that case, how you are going to write JS code that requires jQuery to be loaded?

In one of my Web Development tutorial called 10 tips to speed up your website, I also suggested that you should load your JS files at the end of the document.

5. Put JavaScript at bottom:
This is also good practice in site optimization that you load your JS files just before your footer. This will let the browser draw the page without being blocked by JS files loading.

But the problem is, if you load jQuery at the end of the document and try to write jQuery code before that, you will get errors like $ is not defined. So how to write jQuery code before loading jQuery then!

10 Tips on CSS: The Right Way

We know how important CSS is in case of developing UI in web projects. But most of the time we don’t take it seriously. When we are asked to create PSD to HTML, we simply start writing our HTML and CSS. We do not examine the complete PSD to find out similarly styled elements, similarly styled elements with very view changes such as with border radius and without border radius, floated at left and floated at right etc. Instead of examining the full PSD to find out this kind of design patterns we start writing CSS from TOP to BOTTOM.

I would say, that is a very bad practice.


How to Easily highlight source codes in content?

So if you are a blogger who writes on computer programming and publish source codes in your blog post or if you just want to publish some source codes in your website, then what you can do to stand-out the code from other text is

  • Use <code /> tags
  • Use <pre /> tags
Cool. It will look like codes but not look like as it looks like in your favorite code editor, with different colors for constants, variables, functions, strings etc. along with line numbers.

So, what you want to do is to highlight source codes and make them appearing like in a code editor, which is just not for colors, but for more readability too.

How to Optimize syntax highlighter loading speed?

If you are using SyntaxHighlighter in your blog or website, then you might have noticed that you have to load the brushes you used in a post or page. The way you load them is generally by 

  1. Linking specific brush scripts used on a given page or post, 
  2. Or you load them statically by including all the brushes being used though-out the blog or website.
The first option for loading is disgusting as you have to write the code for each post or pages, however it is better as in this way you load only those brushes you used in an specific post or page.

The second option is better as you don't have to write code for each post or page, but will put impact on website loading speed as you will be loading brush scripts unnecessarily in every post or page despite their usage.

How to connect Webmail with Gmail? Send/Receive emails from/to your webmail email addresses right from/in your gmail account.

Webmail is the mail platform that we get when we buy domains. Webmail generally offers three interfaces, Horde, Roundcube and SquirrelMail. No offense, but none of these interfaces offer modern facilities that we get from mail platforms like Gmail, Yahoo Mail etc. So what can we do?

Well, we can connect webmail with Gmail to Send/Receive emails from/to our webmail email addresses right from/in our gmail account. Yes, it's very possible. The recipients will still see that the email was sent from your webmail email address and not your gmail address. 

So let's get started.

10 tips to speed up your website? Web page optimization tips

Hello everyone and welcome to this tutorial on "How to speed up your website? Web page optimization tips".

Whenever on internet it is basically desired to have things happening faster, right? But your website is not performing good enough? Well, here are 10 site optimization tips that will boost your website loading speed.

5 tips to speed up your website? These Web page optimization tips will give Sonic Boom

Hello everyone and welcome to this tutorial on “How to speed up your website? Web page optimization tips” PART 02.


So, in my last post on website optimization, which is "10 tips to speed up your website? Web page optimization tips – Part 01", I described 10 ways to speed up your website. If you have missed those tips, I think you should not. Today I will be highlighting 5 more ways to actually give a Sonic Boom to your website. So, lets start.