Passing values in JS in objects is by reference

Passing in a primitive type variable like a string or a number, the value is passed in by value. Passing in an object, however, passes it in by reference.

Here is an example:


Multiple background images in CSS

This example will show how to make multiple backgrounds for one div. It is perfect for headers and menus and it contains 3 parts ( left, middle, right ).

.box-header{background-image: url(images/left-orange.png),url(images/right-orange.png);background-repeat: no-repeat,no-repeat;background-position: 0% 0%, 100% 0%;height: 25px;line-height: 23px; text-align:center; width: 99%;margin-bottom: -14px;    position: relative; font-size: 15px; font-weight:bold; margin-top: 20px;}
.box-header::after{background-image: url(images/orange-mid.png); background-repeat: repeat-x;  display:block; width: 91.5%; content:""; height: 24px; margin-top: -23px; margin-left: 14px;}

What is this (IIFE) construct in javascript?

Immediately-Invoked Function Expression, or shorter: IIFE. It executes immediately after it’s created.
This pattern is often used when trying to avoid polluting the global namespace, because all the variables used in the function are not visible outside its scope. It’s good to use when we have multiple functions with the same name.

The output will be 5.

Install and Setup WP Multisite Network

What is WP Multisite?

A WP multisite network allows to run and manage multiple WP sites from a single installation. You can create new websites instantly and manage them using the same username and password. You can even allow other users to signup and create their own blogs on your domain.

To enable Multisite, you need to access your website using an FTP client or cPanel file manager and open wp-config.php file.
Continue reading “Install and Setup WP Multisite Network”

Wamp does not start: Windows 7, 64Bit

1. One solution to fix this problem is the following:

Start > cmd.exe

Inside the Command Prompt (cmd.exe) type:

cd c:/wamp/bin/apache/ApacheX.X.X/bin
httpd.exe -e debug

**Note that the ApacheX.X.X is the version of the Apache wamp is running.

This should output what the apache server is doing. The error that causes Apache from loading should be in there. My problem was that httpd.conf was trying to load a DLL that was missing (icuuc51.dll). As soon as I overwrote this file, I restarted Wamp and everything ran smooth.

2. Other solution is to download vcredist_x86 (Microsoft Visual C++ 2008 x86) from microsoft website.

3. Third option is to click orange icon and hit Apache > Service > Install Service. Click again orange icon and hit Apache > Service > Start Service. Click orange icon and hit Put Online.

Try these methods. I hope this will fix your issue.

Cross domain access to data on the server PHP

If you are doing a ajax call to retrieve data from your own server on a platform which is set to prevent these ajax calls . To bypass “Access-Control-Allow-Origin” you need to allow cross domain access by including this in your server php code.

 header('Access-Control-Allow-Origin: *'); 

OR – for only one domain

 header('Access-Control-Allow-Origin: http//'); 

I hope this will help you gain access to you cross-domain data.

Bootstrap startup template

Hello, I will provide you with basic bootstrap template with great reservation popup.
This template contains:

  • navigation bar with dropdown menu and popup box
  • carousel slider
  • several styles for content
  • fixed footer

Bootstrap is a really fast way to build responsive designs. Once you learn to use it, you will be impressed how good framework Bootstrap is.
Here is the link to -> documentation