Thanks for the tutorial! I encounter a problem though, I can never get the the alert(data.result) to work. I can put some other alert before $.post and it works fine, but nothing inside $.post works.
Firstly: Excellent video, no round the houses small talk, straight to the point - I'll be watching more and subscribing.
Secondly: I wish people wouldn't type in abbreviations when it comes to technical terminology. Really is no help to other people who might want to research any of the points made in the their comments. "Read the Wikipedia article for CI" So this is what I got: wikipediaDOTorg/wiki/CI ..... Yep really helpful thanks
@7thAttempt While in most situations I would agree with you .. but considering this video is about [C]ode[I]gniter its pretty safe to assume that CI is short for Code Igniter ;)
Whew! Finally. Buddy, you made my day. Those last three minutes I listened to over and over. It was finally so clearly defined and I nailed it. Thanks :)
Can I just draw your attention to the title you gave this tutorial... namely the "Simple" part. There's nothing simple about this, coders always assume that the people they're trying to teach already know stuff. Too much assumed knowledge in this one... sorry.
@4st3r1sk because, if you don't cleanse the $_POST array, someone could inject SQL by simply ending the SQL statement to be executed, and writing their own in a field to be sent via $_POST. Not a big issue today, im sure you take proper security measures in live projects.
@k0d3g3ar At the time of this recording I owned a powerbook g4 which couldn't handle screen recording. GTKRecordMyDesktop on my ubuntu box would fail to render any videos over a minute long... My only option was XP, believe me it was a last resort.... regardless this video has tens of thousands of views and tons of positive feedback so say what you will, it got the job done.
@jamesnogra You should actually consider smth like $.post('[php open] echo base_url(...); [php close]'). This way You will get url independently of having index.php in your path
@bigjoey1114 Sure wont - but the video was created to demonstrate how JSON / AJAX works, not how to build a full blown form with validation and support for shitty browsers... do your own research, don't expect a free video to do all the work for you.
Great video! Thank you. Quick question: as a newb php/jquery dev, I'm wondering why you put your jquery events in the global.js file? Is that simply for the sake of the demo? I thought globals.js was more for constants and stuff. THANKS!
The problem with popular Engines and popular OS frameworks is their popularity. They simply cannot dare to keep up with the progress. They have to stay "compatible"... CI is simply poorly designed framework and it is not going to change any time soon because it is so popular (thus stalled). :-( Sad.
@xuldevelopers There are certainly more powerful bleeding edge fmwk's available however I feel CI is much better used as a toolkit, not a convention-up-the-ass framework like ZFor RoR... Read the Wikipedia article for CI... "PHP creator Rasmus Lerdorf spoke at frOSCon in August 2008, noting that he liked CodeIgniter "because it is faster, lighter and the least like a framework.""
"CI is simply poorly designed framework..." ?!!!!! to say that i think you dont know how to use CI and you dont even know how to use PHP OOP.... are you even a programmer???!!!
Thank you! Gonna use this combination for my next project as the designer wants a very responsive application.
Quick question: what is the reason you choose the Zend Enviroment for development? Im about to rechoose a good IDE to speed up my work, coz I didnt like EclipsePDT... phpDesigner 7 looks interesting.
Awesome video, thanks. How would I use this approach for an uploader? I have a CI uploader built but I'd like it to show the "success" or "failure" message inline, instead of on a separate page. What would be the best way to do this? Thanks.
@PortaCustodis Unfortunately ajax file upload is not possible without a hacky iframe or using a flash object to send the data - google for "uploadify"... it is not very codeigniter friendly afaik.
Excellent! Thank you for the time and effort to put this together.
I think that this is exactly what you tried to achieve, to put the small pieces together for everyone that needs a comprehensive guide on how to deal with CI JQuery and JSON.
This is cool, but it would be good if your Ajax was a progressive enhancement of a form that also worked without JavaScript enabled. The number of users on the web without JavaScript enabled is small, but it's good a good practice to maintain.
very informative, i'm a codeigniter+jquery developer my self, i remember when writing such a script would take me an hour at BEST, now i can write it in 5 minutes :D, thanks for the video, i always like watching how other developers code in order to improve my code
You are absolutely correct, however the title of this video was not "How to create a form that will degrade gracefully". The idea here was explaining how to work with JSON,
Yes, that is true but i think it is at least worth a mention, as people will be learning from this and you have the responsibility of saying it will not work if javascript is disabled. For example if a person learning from this uses it on a live site without any knowledge of this it could have implications ?
Yeah no doubt, thanks for pointing that out. DISCLAIMER, this video is for learning purposes only! Do not use this sample code in a production environment where you know your clients will be using archaic browsers.
Instead consider adding a form action and setting "return false;" within the $.post() function.
can someone tell me what might be my problems, because I am doing what the tutorial but my controller does not respond the JSON string. I'm using APPSERVER and have read much of the tutorial Codeigniter. Please expect answers.
Thanks for the tutorial! I encounter a problem though, I can never get the the alert(data.result) to work. I can put some other alert before $.post and it works fine, but nothing inside $.post works.
WhiskeyM1ke 3 weeks ago
Firstly: Excellent video, no round the houses small talk, straight to the point - I'll be watching more and subscribing.
Secondly: I wish people wouldn't type in abbreviations when it comes to technical terminology. Really is no help to other people who might want to research any of the points made in the their comments. "Read the Wikipedia article for CI" So this is what I got: wikipediaDOTorg/wiki/CI ..... Yep really helpful thanks
7thAttempt 4 months ago
@7thAttempt While in most situations I would agree with you .. but considering this video is about [C]ode[I]gniter its pretty safe to assume that CI is short for Code Igniter ;)
thatonesnowboarde 4 months ago
Any thoughts on how to do this with csrf on?
tvduncklee 7 months ago
@tvduncklee Serialize the form in your ajax query
Chusmadones 1 month ago
I am trying to convert frrom Json to html??
do you have any idea how to start to it ??
husain099 7 months ago
Whew! Finally. Buddy, you made my day. Those last three minutes I listened to over and over. It was finally so clearly defined and I nailed it. Thanks :)
Bmud 9 months ago
Can I just draw your attention to the title you gave this tutorial... namely the "Simple" part. There's nothing simple about this, coders always assume that the people they're trying to teach already know stuff. Too much assumed knowledge in this one... sorry.
dougieladd 11 months ago
any manual to learn all this stuff?
eldaguinio 1 year ago
Fantastic intro to jquery & ajax for CI. Very well done!
stormbytes 1 year ago
Comment removed
rax313 1 year ago
can you do $array = array($somevalue =>$someothervalue)?
rax313 1 year ago
@rax313 json_encode supports multi-dimensional arrays so you are all set ;)
4st3r1sk 1 year ago
You programmers are lambs to the slaughter with this $_POST suggestions, etc. Someone will be visiting your servers as root real soon.
k0d3g3ar 1 year ago
@k0d3g3ar Which would you prefer? GET, PUT?? I'm confused how simply using the $_POST variable could compromise a system.
4st3r1sk 1 year ago 6
Comment removed
halibuthero 8 months ago
This has been flagged as spam show
@4st3r1sk you should be using the form helper with form_input(); and $this->input->post();
halibuthero 8 months ago
@4st3r1sk because, if you don't cleanse the $_POST array, someone could inject SQL by simply ending the SQL statement to be executed, and writing their own in a field to be sent via $_POST. Not a big issue today, im sure you take proper security measures in live projects.
DouglasButner 2 months ago
He's running Windows XP? Epic Fail!
k0d3g3ar 1 year ago
@k0d3g3ar At the time of this recording I owned a powerbook g4 which couldn't handle screen recording. GTKRecordMyDesktop on my ubuntu box would fail to render any videos over a minute long... My only option was XP, believe me it was a last resort.... regardless this video has tens of thousands of views and tons of positive feedback so say what you will, it got the job done.
4st3r1sk 1 year ago
$('/index.php/user/process').....
The '/user/process' is the same link you would visit in your browser so if index.php/user/process works in your browser - that is the one to use.
4st3r1sk 1 year ago
Hello,
What if I don't user htaccess, I am still obtaining my URL's via the index.php file. how would my $.post('/user/process' looks like?
jamesnogra 1 year ago
@jamesnogra $.post('/index.php/user/process')...
4st3r1sk 1 year ago
@jamesnogra You should actually consider smth like $.post('[php open] echo base_url(...); [php close]'). This way You will get url independently of having index.php in your path
wipcrk 1 year ago
The best tutorial which I saw - clear short and informative.
chameleonredone 1 year ago
The best tutorial which I see - clear short and informative.
chameleonredone 1 year ago
Won't degrade gracefully.
bigjoey1114 1 year ago
@bigjoey1114 Sure wont - but the video was created to demonstrate how JSON / AJAX works, not how to build a full blown form with validation and support for shitty browsers... do your own research, don't expect a free video to do all the work for you.
4st3r1sk 1 year ago
great!!
CWKnife 1 year ago
Great video! Thank you. Quick question: as a newb php/jquery dev, I'm wondering why you put your jquery events in the global.js file? Is that simply for the sake of the demo? I thought globals.js was more for constants and stuff. THANKS!
drpcken 1 year ago
@drpcken You are absolutely correct, strictly for demo purposes. Thanks for the comment!
4st3r1sk 1 year ago
Awesome tutorial, helped put the pieces of the puzzle together for me. I'll never reload another page just to submit some data.
PuReWebDev 1 year ago
in 6:19, type "demo/process" as processing function
but when i type that in mine, that just wont work
when i type $.post thats when all went wrong.
maybe anyone can help clear this out ??
reidzzzzz 1 year ago
Comment removed
reidzzzzz 1 year ago
That was a very great and simple tut. Thanks for giving me some confidence to go leap into Ajax.
webflamesolutions 1 year ago
Thanks this is very nice and well explained!
warzmx 1 year ago
The problem with popular Engines and popular OS frameworks is their popularity. They simply cannot dare to keep up with the progress. They have to stay "compatible"... CI is simply poorly designed framework and it is not going to change any time soon because it is so popular (thus stalled). :-( Sad.
xuldevelopers 1 year ago
@xuldevelopers There are certainly more powerful bleeding edge fmwk's available however I feel CI is much better used as a toolkit, not a convention-up-the-ass framework like ZFor RoR... Read the Wikipedia article for CI... "PHP creator Rasmus Lerdorf spoke at frOSCon in August 2008, noting that he liked CodeIgniter "because it is faster, lighter and the least like a framework.""
4st3r1sk 1 year ago
Comment removed
dennis3380 11 months ago
Comment removed
dennis3380 11 months ago
This has been flagged as spam show
"CI is simply poorly designed framework..." ?!!!!! to say that i think you dont know how to use CI and you dont even know how to use PHP OOP.... are you even a programmer???!!!
dennis3380 11 months ago
excellent !!
chchwy 1 year ago
very useful and easy to learn tutorial!
thank u very much!
garztub 1 year ago
Awesome tutorial!
Now only if i were Superman so i can see what you are typing that'd be great.
acenspades 1 year ago
@acenspades yeah my screencasts began looking much better when I bought a mac...
4st3r1sk 1 year ago
Thank you! Gonna use this combination for my next project as the designer wants a very responsive application.
Quick question: what is the reason you choose the Zend Enviroment for development? Im about to rechoose a good IDE to speed up my work, coz I didnt like EclipsePDT... phpDesigner 7 looks interesting.
Maverickx89 1 year ago
@Maverickx89 I chose Zend because I really enjoyed the auto-complete and built in SSH.
4st3r1sk 1 year ago
@Maverickx89 Dude, use Netbeans. Much better for CI development
k0d3g3ar 1 year ago
@k0d3g3ar I use netbeans at work, it's great (though SVN is terrible...) Coda at home on my mac.
4st3r1sk 1 year ago
Awesome video, thanks. How would I use this approach for an uploader? I have a CI uploader built but I'd like it to show the "success" or "failure" message inline, instead of on a separate page. What would be the best way to do this? Thanks.
PortaCustodis 1 year ago
@PortaCustodis Unfortunately ajax file upload is not possible without a hacky iframe or using a flash object to send the data - google for "uploadify"... it is not very codeigniter friendly afaik.
4st3r1sk 1 year ago
@PortaCustodis Take a look at PLUpload - it's pretty fantastic.
4st3r1sk 1 year ago
Excellent! Thank you for the time and effort to put this together.
I think that this is exactly what you tried to achieve, to put the small pieces together for everyone that needs a comprehensive guide on how to deal with CI JQuery and JSON.
Thank you!
kpetrop1 1 year ago
You are more than welcome, thank YOU for the kind comment.
4st3r1sk 1 year ago
This is cool, but it would be good if your Ajax was a progressive enhancement of a form that also worked without JavaScript enabled. The number of users on the web without JavaScript enabled is small, but it's good a good practice to maintain.
idevelopwithphp 2 years ago
thank you so much for sharing.
its easy to understand. very nice!
realcoke 2 years ago
amazing.... I will try it!
netgear8085 2 years ago
Very VERY useful. I was struggling with both jQuery Ajax and codeigniter... and in just 9 minutes you cleared away almost everything :) Thank you
TehTooya 2 years ago
Wow, thanks! So happy to help.
4st3r1sk 2 years ago
very informative, i'm a codeigniter+jquery developer my self, i remember when writing such a script would take me an hour at BEST, now i can write it in 5 minutes :D, thanks for the video, i always like watching how other developers code in order to improve my code
cancerish 2 years ago
I totally agree - thanks for commenting.
4st3r1sk 2 years ago
Thank you too...
jameserie 2 years ago
Thank you very much. It's easy to understand how to use jQuery ajax and get json bac under CI framework! Good tutorial.
zawdvfth1 2 years ago
Thank you very much for taking the time to do this...
sreustle 2 years ago
Good to see you're using Synergy !
samuurai1 2 years ago
Synergy is the greatest, I use it across three machines and it never fails. Thanks for the comment.
4st3r1sk 2 years ago
So if javascript is disabled form is useless.
That may be an issue for some folks.
Validation should be javascript frontend, php backend. Best practice to not rely on user browser settings for functionality of an application.
petegiant 2 years ago
You are absolutely correct, however the title of this video was not "How to create a form that will degrade gracefully". The idea here was explaining how to work with JSON,
4st3r1sk 2 years ago
Yes, that is true but i think it is at least worth a mention, as people will be learning from this and you have the responsibility of saying it will not work if javascript is disabled. For example if a person learning from this uses it on a live site without any knowledge of this it could have implications ?
petegiant 2 years ago
Yeah no doubt, thanks for pointing that out. DISCLAIMER, this video is for learning purposes only! Do not use this sample code in a production environment where you know your clients will be using archaic browsers.
Instead consider adding a form action and setting "return false;" within the $.post() function.
4st3r1sk 2 years ago
Very well done! Thank you!
sreustle 2 years ago
Thank You. Simply a great tutorial!
teson2000 2 years ago
Thanks for this, It's made me feel better about jumping into using JSON and CodeIgniter.
thirtysixway 2 years ago
can someone tell me what might be my problems, because I am doing what the tutorial but my controller does not respond the JSON string. I'm using APPSERVER and have read much of the tutorial Codeigniter. Please expect answers.
renzofert68 2 years ago
Perfect. Thank you so much for sharing :)
marukooo123 2 years ago
Thanks, I don't believe I have the source any longer - but could recreate it in a matter of minutes.
Probably have another tutorial this weekend.
4st3r1sk 2 years ago
Absolutely awesome video!!! Thank you for your knowledge and expertise. I really like JSON and didn't know it was so easy to use!
When can we expect the source code?
Onlydole 2 years ago
Very cool tut on JS in CodeIgniter! Well done!
:-)
bigrocka1 2 years ago