Browsing Javascript

Create Live Group Chat With PHP, jQuery & WebSocket

With the introduction of HTML5, a new technology was evolved in 2011 called WebSockets. This technology enables live connection with the server even after the page finished loading. It’s a better, replaceable version of AJAX for client to server communication in the background. With WebSocket technology, its possible to have a direct communication between server and client without any interruption and faster data transmission. So, to demonstrate this to me and for you, We’re going to create a live group chat with PHP, jQuery with the help of WebSockets.

[READ MORE]

Animated AJAX Login Form With jQuery

The Web is growing rapidly. Each day, new features are arriving. With the coming of AJAX, many websites became more easy to handle. With jQuery, websites became more attractive with animations and styles. In this tutorial, we are going to create a stylish animated Login Form with jQuery, CSS & AJAX. With this, the login time for the user is greatly reduced as the page shouldn’t be loader all over again.

[READ MORE]

How To Set Same Cookie On Different Domains

You might have seen sites like Google setting the login status cookie on the various domains of theirs (YouTube, Blogger). As you may know, cookie can’t be set in a different domain from another domain directly. If you’re having multiple sites in where you need to set a cookie from a parent site, you can use basic HTML and JS to set the cookies. Google is using this same way.

[READ MORE]

Compress PHP Site – HTML, CSS & JS

UPDATE Site Compressor is now an app on Lobby. To use Site Compressor, download Lobby and install Site Compressor app. Compressing / minifying a site’s code will improve the data transfer from server to the client. The browser will be easily able to get the content from server. There are a lot of benefits that comes with site compression. I use compression too in my own way. My site Open is heavily compressed.

[READ MORE]

Minify JavaScript Using PHP

Making JavaScript codes is difficult and long. In Web projects, we try our maximum to minify JavaScript and CSS to serve content better. There are many sites on the Web that helps to compress/minify JS code. There is even a PHP Software to do this. In this post, I’ll tell you how to use the PHP jSqueeze library to minify JavaScript code. DownloadDemo Setting Up You can get the class code of JSqueeze from here.

[READ MORE]

Delete Items From JSON or Remove Variables in JavaScript

In PHP, you can directly remove an item from an array using unset function. But there is no unset function in JavaScript. But there is another function that will remove a variable. It’s called delete. Removing variables isn’t the only thing it does. It can also remove items from a JSON array in JavaScript. It’s usage is simple. Just pass the array variable with the name of the key. Like this :

[READ MORE]

MySQL NOW() in JavaScript (UTC & Local)

If you know MySQL, you will certainly know the NOW() function that outputs the current date and time with the timezone of the MySQL server. For easy use and compatibility, we use UTC time zone for storing time in database. If you are running a web app that comply with MySQL, then you need the date function as same as the NOW(). So, I will give you a small function that return the same value as MySQL’s NOW() function in both UTC and local time.

[READ MORE]

Group Chat In PHP With Users’ Typing Status

I wrote a post on creating Group Chat in PHP. A comment was posted by Ravi asking if it was possible to include user’s typing status. It was a fascinating and a good idea to add user’s typing status. So, I worked on the code and knew it was possible. I’m going to tell you how to implement the display of users’ typing status on the Group Chat I created earlier.

[READ MORE]

Native JavaScript Equivalents of jQuery

If you want to do some little task on your website, you don’t need jQuery. But if you only did work with jQuery, you won’t know the JavaScript functions that do the same thing. I have ran in to this problem and found the real JavaScript functions in replacement of jQuery functions. I’m going to share it with you. This post will continue to expand when jQuery adds new functions.

[READ MORE]

‘return false’ vs ‘e.preventDefault()’ In jQuery

I decided to add some improvements to Open and fix some bugs. While I was adding two submit listeners on a form, it didn’t work. I have tried everything but still the problem came up. So, I removed return false; and used e.preventDefault();. It worked ! So, why didn’t the submit listener called on the element ? The problem was return false will do e.stopPropagation() and e.preventDefault(). If e.stopPropagation() is ran, then any other submit event handlers of the element won’t call.

[READ MORE]

Donate

Donate

Past

This blog was once on WordPress. Now a static site. See source code on

GitLab

Projects

Currently working on projects.

MJournalTorrentBroCryptoDonateBrenton

GitHubGitLab

Subdomains

DemosLab