Set and get cookie with Javascript

Javascript function to set cookie: function setCookie(c_name, value, exdays) { var exdate=new Date(); exdate.setDate(exdate.getDate() + exdays); var c_value=escape(value) + ((exdays==null) ? “” : “; expires=”…

List of HTTP status codes

The following is a list of Hypertext Transfer Protocol (HTTP) response status codes. 1xx Informational Request received, continuing process.[2] This class of status code indicates…

Git -basics

Initializing a Repository in an Existing Directory: $ git init Use git add commands that specify the files you want to track, followed by a…

Html codes

Standard ASCII set, HTML Entity names, ISO 10646, ISO 8879, ISO 8859-1 Latin alphabet No. 1 Browser support: All browsers ASCII HTML HTML Dec Hex…

Bookmark Script using jQuery

Here is a bookmark script using jQuery: <script language=”javascript” type=”text/javascript”> $(document).ready(function(){ $(“a.jQueryBookmark”).click(function(e){ e.preventDefault(); // this will prevent the anchor tag from going the user off…

Javascript – get Url

Get Url or Url parts using Javascript: window.location.href – get entire url window.location.protocol – get protocol: “http” / “https” window.location.host – get hostname, e.g: “www.g31zone.com”…

Magento – Categories Images

Get category image: <?php $_category = $this->getCurrentCategory(); $_imageUrl = $this->getImageUrl(); ?> Get category thumbnail: <?php $_category = $this->getCurrentCategory(); $_imageUrl = $this->getThumbnail(); ?>

Loading JavaScript Asynchronously

Sample of loading javascript asyncronously: <script id=”myscript” type=”text/javascript”> (function() { var myscript = document.createElement(‘script’); myscript.type = ‘text/javascript’; myscript.src = (‘http://example.org/myscript.js’); var s = document.getElementById(‘myscript’); s.parentNode.insertBefore(myscript,…

jQuery – preview button in new tab(window), target blank

jQuery – preview button in new tab(window), target blank <!– DOCTYPE –> <html> <head> <title>jQuery – preview button in new tab(window), target blank</title> <script src=”http://code.jquery.com/jquery-latest.js”></script>…