Canned Atropine!!

Navigation Menu

Inheritance (& code reusability) in the world of React

Posted by on in iDevelop, Javascript | 0 comments

People like me who come from the typical Object Oriented background coming from PHP, Java, C# etc would say yes, code inheritance is a good practice. But what do you do when you are working with a language which does not follow your typical OO paradigms?! Yes, I’m talking about Javascript – the language people like to love and hate at the same time. And on top of that, you happen to be working with React, it becomes an altogether different matter.

Read More

Using AJAX in Laravel

Posted by on in iDevelop, Javascript, PHP | 24 comments

This question came up in a forum where I drop by now & then. It is also something that I recall answering previously on one or two occasions. So I thought I’d write about it here with a rudimentary example to provide a gist of how it works.

There’s no mystery or secret voodoo involved in having AJAX work in a Laravel app. On its own Laravel 4 (current version) doesn’t have any API for implementing AJAX, so you’ll need to do the footwork yourself. The basic concept that applies everywhere else applies here as well; grab the data from a HTML form, create an AJAX request and send it to server to a URL on which data is expected. Form data is retrieved on server just like any normal form data would be, the only key part is since you’re dealing with an AJAX request you can’t send back a normal View as response, you’ll need to make your own response with proper headers.

Read More