Posts Tagged “Debugging”

Create Multiple Localhosts

Posted on April 2nd, 2015 by webninjataylor

Change Default Listening Port Go to MAMP > Preferences > Ports and set Apache Port to be 80. Set up Localhosts in Hosts File Edit your hosts file so that you have some domains that will resolve to your local web server… sudo pico /etc/hosts Add the domains you want to resolve to your localhost… 127.0.0.1 […]

Common IE Bugs

Posted on June 23rd, 2014 by webninjataylor

Use _.each(myArray,function) in place of .forEach() myRegex.test(myString) in place of .indexOf() var filter = /0{3}/; if(filter.test(orgInfo.get(‘payeeIdentifier’)) !== false){ … } Use envt.target in place of evnt.currentTarget IE doesn’t understand .trim() method, so add this… /******** FIX FOR IE TO USE TRIM() METHOD ********/ if(typeof String.prototype.trim !== ‘function’){ String.prototype.trim = function(){ return this.replace(/^\s+|\s+$/g, ”); } } IE’s […]

Count CSS Rules in Console

Posted on July 11th, 2013 by webninjataylor

In your console, type… var sheets = document.styleSheets; var rules = 0; for(i=0; i < sheets.length; i++){ if(sheets[i].cssRules !== null){ rules = rules + sheets[i].cssRules.length; } } console.log(‘Rules = ‘+rules); IE limits rules to 4,095.

JavaScript Unit Testing

Posted on May 22nd, 2013 by webninjataylor

Integration tests are for how users interact with an app, and unit tests are for small modules of code QUnit is a framework for writing JavaScript unit tests Simple Implementation Page (tests.php) … <link rel=”stylesheet” href=”css/qunit-1.11.0.css”> … <div id=”qunit”></div> <div id=”qunit-fixture”></div> … <script type=”text/javascript” src=”js/qunit-1.11.0.js”></script> <script type=”text/javascript” src=”js/tests.js”></script> tests.js test(“hello test”, function(){ ok( 1 == “1”, […]

CSS3 Transitions Gotchas

Posted on May 8th, 2013 by webninjataylor

Be very careful when using transition-property: all. You will get TransitionEnd events for properties that you didn’t expect to ever transition Be careful when using shorthand properties, because the number of triggered events varies between browsers Opera and IE don’t trigger events when a negative delay cancels out the duration WebKit has real issues with the priority of properties such […]

PHP Downloading in Localhost Instead of Rendering

Posted on April 9th, 2013 by webninjataylor

PHP will download in your localhost, instead of rendering, if your .htaccess file in the htdocs root doesn’t have this line commented out… # Use PHP5 Single php.ini as default # AddHandler application/x-httpd-php5s .php # (WNT) Removed above line which actually caused PHP to download instead of render.

Tags: ,
Posted in Web ShotsComments Off on PHP Downloading in Localhost Instead of Rendering