G31 Zone
  • About
  • Contact

Set and get cookie with Javascript

Posted on: January 19, 2013 /
Categories: 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=” + exdate.toUTCString()); document.cookie=c_name + “=” + c_value; } Javascript function to get cookie: function getCookie(c_name) { var i,x,y,ARRcookies = document.cookie.split(“;”); for (i=0; i < ARRcookies.length; i++) { x = ARRcookies[i].substr(0,ARRcookies[i].indexOf(“=”));

Read More →

List of HTTP status codes

Posted on: October 6, 2012 /
Categories: HTTP

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 a provisional response, consisting only of the Status-Line and optional headers, and is terminated by an empty line. Since HTTP/1.0 did not define any 1xx status codes, servers must not

Read More →

Git -basics

Posted on: August 29, 2012 /
Categories: Git

Initializing a Repository in an Existing Directory: $ git init Use git add commands that specify the files you want to track, followed by a commit: $ git add *.php $ git add FILENAME $ git commit -m ‘initial commit’ Cloning an Existing Repository: $ git clone git://github.com/schacon/grit.git

Git – Force an overwrite of files on a git pull

Posted on: August 29, 2012 /
Categories: Git

Use this commands to force an overwrite of files on a git pull: git fetch –all git reset –hard origin/master

Html codes

Posted on: August 18, 2012 /
Categories: HTML

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 Symbol Number Name Description 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 20 21 22 23 24 25 26 27 28 29

Read More →

Bookmark Script using jQuery

Posted on: August 18, 2012 /
Categories: 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 to the link var bookmarkUrl = this.href; var bookmarkTitle = this.title; if (window.sidebar) { // For Mozilla Firefox Bookmark window.sidebar.addPanel(bookmarkTitle, bookmarkUrl,””); } else if( window.external || document.all) { // For

Read More →

Javascript – get Url

Posted on: May 8, 2012 /
Categories: JavaScript

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” window.location.pathname – get script name, e.g: “example/index.html”

Magento – Categories Images

Posted on: April 29, 2012 /
Categories: Magento

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

Loading JavaScript Asynchronously

Posted on: January 7, 2012 /
Categories: JavaScript

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, s); })(); </script> Visit this page for entire article.

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

Posted on: December 21, 2011 /
Categories: JQuery

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> </head> <body> <form id=”my-form” method=”POST” action=””> <input type=”submit” name=”submit” id=”submit” value=”OK”> <input type=”submit” name=”preview” id=”preview” value=”Preview”> </form> <script type=”text/javascript”> jQuery(document).ready(function() { jQuery(‘#preview’).click(function(){ jQuery(‘#my-form’).attr(‘target’, ‘_blank’); }); jQuery(‘#submit’).click(function(){ jQuery(‘#my-form’).removeAttr(‘target’); }); }); </script>

Read More →

« 1 2 3 4 5 … 9 »

Categories

  • Apache
  • CentOS
  • Git
  • HTML
  • HTTP
  • JavaScript
  • JQuery
  • Linux
  • Magento
  • MySQL
  • PHP
  • Regular expression (Regex)
  • Smarty
  • Symfony 2 / Doctrine
  • Twig
  • Ubuntu
  • Uncategorized
  • Zend

Archives

  • June 2015
  • May 2015
  • March 2015
  • September 2014
  • October 2013
  • September 2013
  • August 2013
  • July 2013
  • January 2013
  • October 2012
  • August 2012
  • May 2012
  • April 2012
  • January 2012
  • December 2011
  • November 2011
  • July 2011
  • June 2011
  • May 2011
  • April 2011
  • February 2011
  • January 2011
  • December 2010
  • November 2010
  • October 2010
  • September 2010

Recent Posts

  • Connect to VPN from Linux
  • Enable slow query log on MySQL server
  • Doctrine Console Commands
  • Symfony2 Doctrine debug query
  • Mysqldump only tables with certain prefix

Tags

404 not found error apache bundled categories category cms tags command line confirm contact form countries create user customer group name customer logged in disable right click export database front controller git image uploader import database incorrect url JavaScript jquery jquery ajax request Magento mysql mysql show user privileges no right click parameters php print array product attribute product images products read files read folders regions script script execution time session smarty smarty print array stores subcategories tinymce url

Copyright G31 Zone 2022 | Theme by Theme in Progress | Proudly powered by WordPress