Tag Archives: callback

How to Send a Please Call Me on Cell C CodeUnit 01 JUN 2011

A callback, or rather Please Call Me as it has come to be universally known in South Africa, is a rather nifty concept that allows you to send a free SMS to any other Cell C customer asking them to call you back, usually because you don’t have any money on your phone – or are to cheap to use any of your own precious airtime!

Cell C allows each customer five Please Call Me SMS messages per day, and to send is actually pretty simple.

All you have to do is dial *111*cellphone number# (where ‘cellphone number’ is the friend’s phone you want to contact) and a Please Call Me SMS will automatically be delivered to the relevant person at no cost to you.

Nifty.

How to Send a Please Call Me on MTN CodeUnit 03 MAY 2011

A callback, or rather Please Call Me as it has come to be universally known in South Africa, is a rather nifty concept that allows you to send a free SMS to any other MTN customer asking them to call you back, usually because you don’t have any money on your phone – or are to cheap to use any of your own precious airtime!

MTN allows each customer two Please Call Me SMS messages per day, and to send is actually pretty simple.

All you have to do is dial *121*cellphone number# (where ‘cellphone number’ is the friend’s phone you want to contact) and a Please Call Me SMS will automatically be delivered to the relevant person at no cost to you.

Nifty.

How to Send a Please Call Me on Vodacom CodeUnit 26 APR 2011

A callback, or rather Please Call Me as it has come to be universally known in South Africa, is a rather nifty concept that allows you to send a free SMS to any other Vodacom customer asking them to call you back, usually because you don’t have any money on your phone – or are to cheap to use any of your own precious airtime!

Vodacom allows each customer ten Please Call Me SMS messages per day, and to send is actually pretty simple.

All you have to do is dial *140*cellphone number# (where ‘cellphone number’ is the friend’s phone you want to contact) and a Please Call Me SMS will automatically be delivered to the relevant person at no cost to you.

Nifty.

jQuery: Bind an onClick Event to an Item in a DataTables Row CodeUnit 14 MAY 2010

As it has quickly become apparent on this site, my two current favourites in the land of web development is the fantastic jQuery javascript library and the brilliant jQuery-based DataTables plugin that gives you instant dynamic table features applied to any bog standard HTML table.

The problem that I’m solving today arose from my desire to include a positive/negative flagging system to data being displayed in a DataTables view. So in each data row I added a column that contained both a greyed out happy and sad smiley face, on which the user will be able to click in order to color the appropriate face and thus indicate a state for that particular row of data.

The idea is simple enough. Click on the smiley face and the script will then fire off an ajax post to a script handler which will fiddle in the database and return the correct state which in turn changes the image accordingly – pretty standard AJAX stuff in other words.

However, herein lay the problem.

Because the DataTables was being fed through a server-side script, in other words the actual table data is loaded by the DataTables plugin itself, my jQuery function that was supposed to interact with the clicking of a smiley face couldn’t work because the elements it was meant to interact with simply didn’t exist when the page’s initial DOM tree was being loaded.

So how to solve this?

Well the solution obviously lies in binding the newly created elements to my existing click handler function, but the question remains – how exactly does one do this if the table data is being loaded through a jQuery function?

Well the answer lies with the DataTables-provided callback function entitled fnDrawCallback, which is called on every ‘draw’ event – in other words the perfect little hook to attach your jQuery code, which is to interact with the DataTables-loaded DOM data, to.

So how does one use this callback functionality then? Well the magic all gets stuffed into the DataTables constructor function. First, we declare the function that is to be run on the click event happening. Then, we bind this function to the click event for the desired elements in the standard jQuery manner. And then for the crucial point, this binding is done as part of the fnDrawCallback declaration in your dataTable constructor call.

So let’s see this in action:

//onClick handler function
function flagsmileysadclick()
{
	$(this).load('ajax_set_smiley_flag.php',{'smileyid':$(this).attr('id')});
}

//DataTables constructor
oTable = $('#commentstable').dataTable({
"bProcessing": true,
"bServerSide": true,
"iDisplayLength": 50,
"bLengthChange": false,
"sAjaxSource": "datatables_comments_list.php",
"sPaginationType": "full_numbers",
"aaSorting": [[ 0, "desc" ]],
"fnDrawCallback": function() {
  //bind the click handler script to the newly created elements held in the table
	$('.flagsmileysad').bind('click',flagsmileysadclick);
}
});

And that’s actually it. Simple, but effective, and a nice introduction to the handy fnDrawCallback feature of DataTables.

How to send a Vodacom Please Call Me Tips, Tricks and Tutorials 24 JAN 2010

This is actually more of a reminder to me than anything else, because no matter how many times I try, I simply can’t remember how to send one of these damn things from my phone when it matters (not that I ever do of course – but they do come in handy when you are testing SMS response systems for example!)

Way back in 2000 Vodacom launched this money-making scheme… urm service, which essentially allows a vodacom client to send a free SMS to another person asking them to phone back (like in the instance when you have no money but you really want to talk to your stripper girlfriend.)

Vodacom pushes the request to the person (they do about 20 million a day) and attaches advertising to the Please Call Me request, which in other words has the potential to bring in a huge chunk of advertising revenue per month for the buggers – just saying.

Anyway, back to the ‘how to’ at hand, because I’m getting a little off the track here. In order to send a Please Call Me to another person, you simply need to dial *140*phonenumber# where phonenumber is the number of the person that you wish to make contact with. (And don’t forget the control character # at the end.)

And that’s that. Pretty simple after all. You’d think someone like me would remember that, now wouldn’t you? O.o

(Oh, and as an added feature, if you dial *140# from your phone and follow the relevant menu options, you can actually set a name that is to be added after each Please Call Me request – meaning now at least the recipient knows who is trying to get him to spend some money by asking him to give a call back in the first place!)

Related Link: http://www.vodacom.co.za/services/callme_how.jsp