Background
It can be hard sometimes to think straight when your mind is seemingly having a conversation with itself. It’s very easy to get drawn into the ‘conversation’ as if it is about real things, when it is invariably about something that has happened in the past or something that may happen in the future.
If you can observe the ‘conversation’ or chattering monkey as it is sometimes referred to, then obviously you are not the chattering monkey but rather the observer. This means that there is a way to control the chattering monkey and gain enough space in the present moment to think calmly.
The more ‘space’ you can create in the present moment, the more time you will have at your disposal to be more calm.
Technique
Nothing really fancy here, we’ll leave that up to the oh so sophisticated chattering monkeys
Sit on a chair with an upright back and try to keep your spine as straight as possible. If it hurts or aches then just rest it on the chair back. The idea is not to fall asleep but to remain focused on the task.
Breathe in and out normally through your stomach, not your chest, using your nose, not mouth.
Close your eyes gently.
Observe your breath going in through your nose, filling your diaphragm, and then going out again.
Keeping doing this, ie. observing your breath.
How to deal with your attention wandering
Your attention will invariably begin to wander off concentrating on something as simplistic as observing your breathing.
When this happens, the best thing to do is not to fight and wrestle with your attention but just to observe that thought for a while, and then bring your attention back to your breath.
One way I do this is to picture my mind as the blue sky and various thoughts that cross my mind as clouds. Then whenever a thought crosses my mind and I notice that my attention has drifted from my focus on my breathing, I just gently blow that metaphoric cloud away and return my attention back to my breathing.
How to deal with the boredom of just focusing on your breath
Your chattering monkey will get bored easily and try to draw your attention off the present and into thinking about the future or the past.
You can focus on other ‘present moment’ things as well that will have the same effect as watching your breathing. So you can also focus on any sounds that you hear, being careful not to interpret them but just hear the different noises as ‘noise’ only. Try and keep focused on the noise and use the cloud technique above to whoosh off any passing by thoughts. You can also pay attention to the lights that you see on the back of your closed eyelids.
Try and keep attention to one of these present moment things as long as you can; only switching to a different attention focus when you need to.
How Long Should You Do It For?
Try it for a few minutes at a time to start and then work your way up to about 10 to 15 minutes a day. This method of controlling your mind works by frequent application rather than one-off massive efforts.
I usually use a timer countdown alarm on my iPhone that will alert me when my time is up. That way I can keep my eyes closed and not worry about how long I’ve been doing the exercise for.
Body relaxation
Your mind tends to follow the relaxation state of your body and vice versa, so when you sit down to do this exercise you can mentally relax certain muscle groups as you breathe in and out.
You do this by just moving your attention over certain muscle groups and ‘feeling’ some sort of loosening or relaxing sensation in each part.
I start with my both my feet, move my attention up through shins and calves. Then knees and so on upwards. I particularly focus on my head and feel my attention relaxing my forehead, cheeks, jaw, back of my neck and shoulders.
You don’t have to push to relax your muscles, just imagine that they are relaxing a little more than they were before you brushed them with your awareness.
Once you feel a little more relaxed then focus on your breath as you breathe normally.
Summary
- Sit down on a chair
- Close your eyes
- Relax your body physically
- Focus on breathing, outside noises and/or lights on back of eyelids
- Observe thoughts and direct attention back to breathing/noises or lights.
- Work up from a couple of minutes to 10-15 minutes per day
I run paid web traffic to my various internet properties, mainly because I hate being at the mercy of search engines and their goofy algorithm updates. As this is not “free” organic traffic, you can imagine that I keep a close eye on it, and I’ve noticed a very interesting thing that you’d be crazy not to cash in on the mobile phone market share.
EDIT: I just found a course that is widely recommended to get into the lucrative mobile market. Click Here For More Info
Watch the short video below where I show you the reality of whether you should focus on mobile web traffic.
EDIT: There is a great course that is widely recommended to get into the lucrative mobile market. Click Here For More Info
Guess what! There’s a world out there that has nothing to do with the current politics, inflation rates, GFC’s, carbon taxes, and what’s happening on the latest tv series. It’s a universe that you and I are a part of and most people know absolutely nothing about.
The world is in a pretty sticky energy situation in that current technology affords us only 2 choices to follow. One is to continue using non-renewable resources as well as polluting the planet, and the other is stop and live as though we are back in the agricultural age.
Kind of reminds me of the sales approach of offering 2 choices, one being really expensive and the other seeming ok, relatively speaking. Or a country only offering you 2 political parties and calling itself a democracy…. but I digress.
If you really want to a get a clue as to how this universe ticks, and hence actually help solve the current energy predicament, then I suggest you watch the lectures by Dr. Richard Feynman.
These were given back in the days before I was born, in 1964, and were so good that BBC TV had the rights for years until Bill Gates from Microsoft bought them and has made them public for all to see.
Gates says that he wants to make it so any kid can click on them and learn a thing or two about physics. My view is that these lectures are appropriate for someone that has finished matriculation (that’s college I think in the US education system) and is going on to a Bachelor degree.
They start off quite simply but then dive into some pretty advanced concepts that only Feynman manages to still make accessible to the physics newbie.
So do yourself a favour and watch the Feynman lectures.
If enough people get educated and focused on actually solving the energy problem rather than watching politicians argue with each other on tv, we will have a better chance of actually moving forward and progressing as a society.
It’s definitely food for thought.
I wanted to write a short article on why it is so important to approach the development of an enterprise system using proper domain driven architectural principles. The reason why is because there seems to be a lot of existing systems that have not been architected with the needs of a business in mind, or at least there has been some sort of disconnect between business needs and system development.
So many systems get built with no supporting documentation to enable adequate handover to new developer teams. You see network administrators being lumped with development tasks that are completely out of their skill-sets because there is no resource requirements defined for such systems.
Updates for complex systems get very difficult to apply if it is not known what code dependencies exist. Testers do not understand the system and keep telling developers that this ‘doesn’t work’ without providing a business analyst style of reference.
This situation can get very ugly as it tears at the very fabric of joint ventures and even inside organisations. So who’s at fault for this sort of situation happening? Is it the stakeholder’s fault for not managing their funds correctly? Is it the developer’s fault for not approaching enterprise system design correctly?
My opinion is that is not the business or the developer’s fault as they are just doing the best they can with what they know. Let’s look at what is really going on though to end up in this position.
Step 1. Business says, I want a system like ‘this’. How long will it take to finish it?
Step 2. Developers say, that system will take x days/months.
Step 3. Business says OK. Let me know when you’re done.
Step 4. Business says, are you done yet?
Step 5. Developer says, yep all done. Pretty cool eh! See you later.
Step 6. Business says, Hey new developer we want this done to our system, how long will it take?
Step 7. Developer says, well I reckon it might take y days/months but not sure about the code.
Step 8. Business says, so you done yet?
Step 9. Developer says, well I thought I would be but I don’t know about this code and is this really what you want to do to your system?
…… this is when it becomes apparent that something must have been missing in between these steps to get into this unfortunate situation.
What was missing was the developer putting on their architect hat and saying to business at step 2.. Hold On A Minute.. I’m the expert here and you need to work with me side-by-side to arrive at a plan of building your system so that we can truly align the code with your business objectives.
An analogy is if you have a really bad headache and you go to your doctor. Do you tell your doctor that you want to have the headache fixed and this is the medication and care to use? If you do, you might as well try and fix it yourself and save yourself the fee. But worse, if the doctor then just says, oh ok what would you like me to do? It would be a sign of malpractice and a very shoddy treatment indeed.
So why do a great majority of developers do the same type of thing, and just accept that business knows how to architect an enterprise class system? My view is that it is simply a lack of knowledge on the part of developers and teams leads/architects, requiring a skill set outside of coding or simply managing a team of people.
Granted, there are team leads,etc.. that do ‘confront’ business and say no, we need to use this technology, but this is just the same thing happening from the ‘technical’ side without regard to the business objectives as the driver of the system.
Technical expertise needs to be ‘combined’ with business objectives to arrive at an enterprise class system that will survive at least the first round of new developers, updates and overhauls. There is an inherent need to create a business domain driven architecture that flows directly from business requirements to code fragments. A wholistic perspective is required to transfer use-cases to test-cases, even before code is written. I’m definitely a fan of agile style development but this does not mean flying by the seat of your pants and producing throwaway code, just because it is the first iteration.
So my point is this. If you are a developer/architect/team lead/tech person then understand that a process is required to align business requirements first in an architectural sense before you begin coding or setting up Microsoft Project. If you are on the business side, then consult with your technical experts on your objectives and then get the most benefit you can before ordering yourself a system.
A side-by-side methodology gives businesses much more valuable systems for the same price. If you are working with a business domain driven architect you can achieve a much better ROI than the traditional top-down management approach.
I just made a post on a LinkedIn Group that answered a question that happens a lot to business startups, entrepreneurs, and anyone else trying to get a project off the ground with a programmer.
Even working as a sole developer I have found that using a SCRUM based Agile approach with the client solves a lot of the traditional problems of cost overruns and delays.
Daily contact, high visibility, and communication of possible impediments to the time line is now crucial to get a proper Rapid Application Development (RAD) cycle.
SCRUM is the process now that most high profile commercial web systems use because it alleviates the traditional problems of blowing budgets and a constantly moving deadline.
Simply giving a spec to a developer to go away and come back with the finished product is fraught with danger.
If you hire people that know what they are doing but charge a little more, you will save money, and in the short run too if they use SCRUM.
I use Axosoft OnTime to manage projects with SCRUM methods. You can find out more information from here.
Very excited about a new product I’m about to launch! I’m very sure that it will solve a big problem that a lot of facebook marketers are having, and that is.. converting Fanpage Likes into dollars ($$$$).
This is such a simple app, and that is it’s greatest strength. Without saying too much, the app will move fans back under control of an email marketing list.
We all know that the ‘Money is In The List’ – and this is the greatest secret of super affiliates that can push a ‘send’ button and earn thousands in a single email blast.
Now fit this with the sheer massive numbers of people people professionally added to fanpages via traffic hubs and facebook paid advertising, and you have a pure money machine – if done professionally.
This sort of thing could be setup up by a facebook programmer and takes time and thus money – the new app I’m about to release means you can do it yourself within minutes, and it’s really, really user friendly – definately no expensive programmer required.
Got a lot of work to do before I release this but if you want to get advance notice of when this app is available, fill out the below form and I’ll put you on the list. Oh, and before you ask, the price is going to be really cheap – want to make this affordable as possible.
OK, don’t shoot me down just yet! This article is titled ‘When A business account on facebook is a Total Waste Of Time’ only because I want to highlight what business owners might be doing wrong when they set up a page for their business on facebook.
[ Free facebook training on now ... hurry => facebook.businesswithease.net ]
I am not saying that facebook is a waste of time for business. On the contrary, it is the most amazing resource that meets the attention economy head-on with way more stickability than anything else seen on the internet period!
So how the heck can you put up a fan page for your business and get people to actually ‘like’ what you’re doing rather than blow you off as just another advertisement?
I’ll assume that you already have a fan page up for your business already. If you need more info on the actual mechanics then check out facebook business accounts help. There is also a really good business resource if you want to profit from facebook marketing in a big way, and who doesn’t ?
Potential Customers Hate Being ‘Sold’ But They Love To Buy
Welcome to social media. If you stand on your soap box and shout about your products, you can be howled down in a social media environment as you are not part of the group. Or worse, you can be totally glossed over in a form of banner blindness. You need to engage people in their conversations, create them, answer people, and generally be of help in solving their problems with your product.
Consider Using A Traffic Hub
Don’t throw out google with the bathwater, just because you’ve heard that there is more traffic on facebook now. Get smart and you can funnel traffic from demographic based searches that your potential customers are doing to a blog with a simple like button on it that links back to your fan page. Use ‘Add Like Box’ in the promote this page on your website options.
Link Your business account on facebook To Twitter Feed
There is also an option to link your fan page to twitter so that followers can see your updates. If you’re going to make a noise then you might as well make sure you get maximum coverage for your efforts.
Get Initial Traffic By Outsourcing
There’s the whole chicken and egg thing going on when you start something new in a social media space. People want to join others that are already popular, but how do you get popular if nobody will join you in the first place, because er.. noone else has?
You can actually give your business account at facebook a kickstart by visting a site called fiverr.com where people will do all sorts of things for 5 bucks. Just type in facebook marketing and you will be able to get a lot of likes to your page to start the ball rolling with more targeted prospects.
Paid Traffic Methods
Now if you really want to pump some traffic then you can look at facebook paid advertising, but before you do this you should really get some specialized advice. My first foray into facebook was to put up some ads and watch the money bleed away – not fun!
There is free facebook training on now at facebook.businesswithease.net - not sure how long they will be open for though.
So, hopefully that has sparked off a few more ideas for you to get your business account at facebook working hard for your business. Let me know your thoughts, or any other suggestions you have.
Last week I went to the 2011 Affili@Syd affiliate conference in Sydney, Australia which was a real eye-opener for me, mainly as to the current state of affiliate marketing in Australia.
There were some really top notch speakers there that made it worthwhile giving up a day of riveting coding

Susan Bratton
Susan Bratton was the keynote speaker and gave us a heap of info on conversion strategies. It’s the kind of stuff that you think you know but are not implementing it yet – so for me Susan made things more simpler and able to be systemised.
She has a site that has a host of info called conversiontriggers.com, so you definitely want to check out that (hoping this is ok Susan?).
The 2 best take-away lines I got from Susan were:
- Internet marketers need to join in with the conversation a person is having with him or herself. You can’t just shout at people and tell them to buy your stuff. You have to get involved with what they are thinking.
- Persuasion is a sequence of emotions. This was very enlightening for me especially when you combine this understanding with running people through up and down emotions as you tell a story to the reader.

Dave Cupples
Dave Cupples really took me by surprise. This guy is an amazing success story (started first business at the age of 4!) and a real dynamo. It’s really great to see guys like this ripping apart the market and going full steam ahead.
Dave had just spoken at a European affiliate marketing conference and was on fire. His forte is social media marketing and and I wrote pages of notes. Facebook marketing has been a bit of a mystery to me since I put up some ads a while back that were immediately rejected – but Dave has a great twist on this.
Best take-aways from Dave:
- Give value first and build desire before you pitch, and
- Cleavage! You’ll need to talk to Dave about this one
Daves site is at fatcowbusiness.com. Download his facebook marketing pdf. This has some really good stuff where he walks his talk.
As to the state of affiliate marketing in Australia. Let’s just say that there is a huge amount of potential, and my thoughts are that some trailblazing is required to help more e-tailers to take notice of how powerful performance based marketing can really be for them.
I’ll leave some of the other topics covered at the seminar for the some future posts. Highlight topics were the Group Buying boom, tried and true email database marketing, and more about facebook marketing.
I use jQuery quite a lot now and have found that it helps enormously to know how to properly debug it without resorting to javascript alert boxes. Firefox is my weapon of choice and still seems to be way easier to control than IE developer tools or even Chrome (yet!).
jQuery – Unobtrusive Code
A major benefit of jQuery over standard inline javascript is that it keeps it out of the html markup.
Example:
<script type="text/javascript">
$(function() {
$('helloUnobtrusive').bind('click', function() {
$(this).text('Hello Unobtrusive');
});
});
</script>
<p id="helloObtrusive"
onclick="$(this).text('Hello Obtrusive'); return false;">
Hello Obtrusive JavaScript!
</p>
<p id="helloUnobtrusive">Hello Unobtrusive JavaScript!</p>
Makes much cleaner code and graceful degradation when javascript is turned off, but now it’s harder to debug.
Tools
- Firebug http://getfirebug.com/
- FireQuery http://firequery.binaryage.com/
- FireFinder https://addons.mozilla.org/en-US/firefox/addon/11905
Example HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<title>Sandbox</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<style type="text/css" media="screen">
body { background-color: #000; font: 16px Helvetica, Arial; color: #fff; }
</style>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript">
</script>
</head>
<body>
<div>
<a id="selectMe" href="http://johnayling.com">This is me...</a>
</div>
<pre><code>
$('div a')
</code></pre>
<a href="http://johnayling.com" target="_blank">View, Run, & Edit Code</a>
</body>
</html>
Debugging Selectors
Starting point is getting the right selector. From there you can attach events, and so on.
Using the Console tab on Firebug
$(‘div a’) returns jQuery(a#selectMe johnayling.com)
$(‘div a.incorrectClass’) returns jQuery( ) ie. nothing in the jQuery array as there is no match.
Using FireFinder
The goal is to find all the links referencing zip files with a title that starts with “John”
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Example 2 - Selectors</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<style type="text/css" media="screen">
body { font: 16px Helvetica, Arial; }
</style>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript">
//Try to select all links referencing zip files w/ title's that begin w/ John (Note: This is wrong)
$("div a[href$='.zip'][title*='John']").click(function() {
console.log("I've been clicked!");
});
</script>
</head>
<body>
<div>
<p><a href="http://johnayling.com/john1.gif">john1.gif w/ no title</a></p>
<p><a href="http://johnayling.com/john2.zip">john2.zip w/ no title</a></p>
<p><a href="http://johnayling.com/john3.zip" title="John, Pick Me! 1 of 3">john3.zip w/ prepended John title</a></p>
<p><a href="http://johnayling.com/john4.zip" title="John, Pick Me! 2 of 3">john4.zip w/ prepended John title</a></p>
<p><a href="http://johnayling.com/john5.zip" title="Pick Me John!">john5.zip w/ John in middle of title</a></p>
<p><a href="http://johnayling.com/john6.zip" title="John, Pick Me! 3 of 3">john6.zip w/ prepended John title</a></p>
</div>
<pre><code>
FireFinder: div a[href$='.zip'][title*='John']
</code></pre>
</body>
</html>
div a[href$='.zip'][title*='John'] – wrong selector for finding ‘starts with’
div a[href$='.zip'][title^='John'] – right
Debugging Events
Another problem you might want to debug is where code has been attached to the wrong event or the event handler has been attached to the wrong element.
Using FireQuery
Example 3 – Firebug HTML tab
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Example 3 - Events</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<style type="text/css" media="screen">
body { font: 16px Helvetica, Arial; }
</style>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript">
$(function() {
$('#helloWorld').bind('click', function() {
$(this).text('Hello John!');
});
$('#goodbyeWorld').live('click', function() {
$(this).text('Goodbye John!');
});
$('#whoWroteThatSong').data('artist', 'THE BEATLES');
});
</script>
</head>
<body>
<p id="helloWorld">Hello World!</p>
<p id="goodbyeWorld">Goodbye World!</p>
<p id="whoWroteThatSong">Hello Goodbye</p>
</body>
</html>
Hello world has click event attached to it. Hover to see the function that will be executed on a click event.
Data key ‘artist’ is being used to store ‘THE BEATLES’ to the #whoWroteThatSong p element.
Debugging Using Breakpoints
Example 4
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Example4 - Set Breakpoints</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<style type="text/css" media="screen">
body { font: 16px Helvetica, Arial; }
</style>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript">
$(function() {
$('button').click(function() {
var firstName = 'John';
var lastName = 'Ayling';
var fullName = firstName + ' ' + lastName;
console.log("Your name is %s. I hope you have a great day!", fullName);
});
});
</script>
</head>
<body>
<p><button>Click Me</button></p>
</body>
</html>
Set breakpoint on line to see the code flow and variable values.
var firstName = ‘John’;
Can see control flow, stack traces and watch
Set to Automatically Break on Error
Set the Enable Break On All Errors feature in Firebug to start a debug session automatically when an error occurs.
You can turn on this feature by clicking the Pause button in the top menu on the Console tab.
You might have to select the ‘Script’ menu depending on which version of Firebug you are are using.
Example 5
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Example 5 - Break on Error</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<style type="text/css" media="screen">
body { font: 16px Helvetica, Arial; }
</style>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript">
$(function() {
$('button').click(function() {
var firstName = 'John';
var x = x.fakeFunctionCall();
var lastName = 'Ayling';
var fullName = firstName + ' ' + lastName;
console.log("Your name is %s. I hope you have a great day!", fullName);
});
});
</script>
</head>
<body>
<p><button>Click Me</button></p>
</body>
</html>
How to Tell Which Element Has Triggered an Event
Look at watch window and as step into the function that has been triggered, look at the ‘this’ variable.
Example 6.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Example 6 - Element Trigger</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<style type="text/css" media="screen">
body { font: 16px Helvetica, Arial;}
</style>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript">
$(function() {
$('#helloWorld').bind('click', function() {
$(this).text('Hello john!');
});
$('#goodbyeWorld').live('click', function() {
$(this).text('Goodbye John!');
});
});
</script>
</head>
<body>
<p id="helloWorld">Hello World!</p>
<p id="goodbyeWorld">Goodbye World!</p>
</body>
</html>
Set breakpoint on line $(this).text(‘Hello john!’);
How To Tell Where an Error Originates From When an Error is Coming From Helper Methods
Set a breakpoint and look at the Stack tab.
Example 7
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Example 7 - Stack Trace</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<style type="text/css" media="screen">
body { font: 16px Helvetica, Arial; }
</style>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript">
$(function() {
$('button').click(function() {
console.log(fullName());
});
});
function fullName() {
return firstName() + ' ' + lastName();
}
function firstName() {
return 'John';
}
function lastName() {
return 'Ayling';
}
</script>
</head>
<body>
<p><button>Click Me</button></p>
</body>
</html>
Put breakpoint on return ‘John’, view ‘Stack’ tab and follow path into the jQuery library code.
How To Determine Where A Bottleneck is Where Processing is Taking Too Long to Execute
This is a very handy thing to know and can very quickly help you hone into where your ‘client app’ is slowing down processing on the page. Ever got a browser warning box pop up that the script has gone on too long? – this is the first step in solving this.
Example 8
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Example 8 - Profiler</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<style type="text/css" media="screen">
body { font: 16px Helvetica, Arial; }
</style>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript">
$(function() {
$('button').click(function() {
var randomNumberSum = 0;
for (var i = 0; i < 100000; ++i) {
randomNumberSum += getRandomNumber(10);
}
console.log('Random Number Sum: %d', randomNumberSum);
});
function getRandomNumber(maximumNumber) {
return Math.floor(Math.random() * getNumberPlusOne(maximumNumber));
}
function getNumberPlusOne(number) {
return number + 1;
}
});
</script>
</head>
<body>
<p><button>Click Me</button></p>
</body>
</html>
Click ‘Profile’ button, execute code, click ‘Profile’ button again to see performance statistics.
How to Inspect the Contents of An Ajax Call
Example – predictive search
http://www.infolink.com.au/
Look at GET request on ‘Console’ tab made when typing text into predictive search box
Using Conditional Breakpoints
Example 9
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Example 9 - Conditional Breakpoints</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<style type="text/css" media="screen">
body { font: 16px Helvetica, Arial; }
</style>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript">
$(function() {
$('button').click(function() {
var randomNumberSum = 0;
for (var i = 0; i < 100000; ++i) {
randomNumberSum += getRandomNumber(10);
}
console.log('Random Number Sum: %d', randomNumberSum);
});
function getRandomNumber(maximumNumber) {
return Math.floor(Math.random() * getNumberPlusOne(maximumNumber));
}
function getNumberPlusOne(number) {
return number + 1;
}
});
</script>
</head>
<body>
<p><button>Click Me</button></p>
</body>
</html>
Set stop on randomNumberSum += getRandomNumber(10);
Right-click stop and enter expression 1 == 32








