home | contact us
» Archive by category "debugging"

category: debugging


If Chrome is displaying mix content errors this means that Chrome thinks that some of the resources on the page where loaded over HTTP rather than HTTPS. But one behaviour of Chrome that might catch you out is that if Chrome at any point on a domain encountered a page with mixed content, it will then treat the whole site as having mixed content even if a given single page does not have mixed content. Chrome is unlikely to tell you this is the reason a single page has mixed content, the best way to tell is to keep closing chrome, starting a new session and browse until you get mixed content.


 

Ever need to quickly test some HTML that you copied from some where?

If you have Firebug installed, you can open a new tab, go the the HTML tab in Firebug, click edit and paste your HTML and Firefox will render it. This is faster than having to open a text editor, paste the contents and save the file, but JavaScript on load events won’t fire.


 

If you are a windows user, you may be familiar with the Beyond Compare programme which is used to compare two text files. This can be an invaluable tool when you are debugging or tracking changes as it highlights for you any differences between two text files.

For Ubuntu, there is an excellent programme called Meld which offers the same functionality and works very well. You can download and install it easily using the Add/Remove tool in your applications menu.

You can read all about Meld here

Another great open source linux package!


 

When coding PHP, or more frequently when trying to customise or fix someone elses code, it can sometimes be tricky to figure out exactly what is going wrong.

In this kind of situation, it is often neccessary to go through the flow of the script and view the contents of the various strings and arrays at that stage of the script.

I have written this small function to help in this process:

function dbug($item){
	echo '<hr><h3>Debug Info</h3>

		

<hr>';	
}

This script will take any item and print out detailed information for you in a nicely formatted and easy to read way.

For an example when you might decide to use this functionality, you could check the contents of your $_POST

<?php
/*very top of script */
dbug($_POST);

 
rss icon