Added: 2 years ago
From: 4st3r1sk
Views: 56,780
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:

All Comments (74)

Sign In or Sign Up now to post a comment!
  • 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 ;)

  • Any thoughts on how to do this with csrf on?

  • @tvduncklee Serialize the form in your ajax query

  • I am trying to convert frrom Json to html??

    do you have any idea how to start to it ??

  • 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.

  • any manual to learn all this stuff?

  • Fantastic intro to jquery & ajax for CI. Very well done!

  • Comment removed

  • can you do $array = array($somevalue =>$someothervalue)?

  • @rax313 json_encode supports multi-dimensional arrays so you are all set ;)

  • You programmers are lambs to the slaughter with this $_POST suggestions, etc. Someone will be visiting your servers as root real soon.

  • @k0d3g3ar Which would you prefer? GET, PUT?? I'm confused how simply using the $_POST variable could compromise a system.

  • Comment removed

  • @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.

  • He's running Windows XP? Epic Fail!

  • @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.

  • $('/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.

  • 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 $.post('/index.php/user/proces­s')...

  • @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

  • The best tutorial which I saw - clear short and informative.

  • The best tutorial which I see - clear short and informative.

  • Won't degrade gracefully.

  • @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!!

  • 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 You are absolutely correct, strictly for demo purposes. Thanks for the comment!

  • Awesome tutorial, helped put the pieces of the puzzle together for me. I'll never reload another page just to submit some data.

  • 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 ??

  • Comment removed

  • That was a very great and simple tut. Thanks for giving me some confidence to go leap into Ajax.

  • Thanks this is very nice and well explained!

  • 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.""

  • Comment removed

  • Comment removed

  • excellent !!

  • very useful and easy to learn tutorial!

    thank u very much!

  • Awesome tutorial!

    Now only if i were Superman so i can see what you are typing that'd be great.

  • @acenspades yeah my screencasts began looking much better when I bought a mac...

  • 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 I chose Zend because I really enjoyed the auto-complete and built in SSH.

  • @Maverickx89 Dude, use Netbeans. Much better for CI development

  • @k0d3g3ar I use netbeans at work, it's great (though SVN is terrible...) Coda at home on my mac.

  • 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.

  • @PortaCustodis Take a look at PLUpload - it's pretty fantastic.

  • 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!

  • You are more than welcome, thank YOU for the kind comment.

  • 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.

  • thank you so much for sharing.

    its easy to understand. very nice!

  • amazing.... I will try it!

  • Very VERY useful. I was struggling with both jQuery Ajax and codeigniter... and in just 9 minutes you cleared away almost everything :) Thank you

  • Wow, thanks!  So happy to help.

  • 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

  • I totally agree - thanks for commenting.

  • Thank you too...

  • Thank you very much. It's easy to understand how to use jQuery ajax and get json bac under CI framework! Good tutorial.

  • Thank you very much for taking the time to do this...

  • Good to see you're using Synergy !

  • Synergy is the greatest, I use it across three machines and it never fails. Thanks for the comment.

  • 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.

  • 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.

  • Very well done! Thank you!

  • Thank You. Simply a great tutorial!

  • Thanks for this, It's made me feel better about jumping into using JSON and CodeIgniter.

  • 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.

  • Perfect. Thank you so much for sharing :)

  • 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.

  • 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?

  • Very cool tut on JS in CodeIgniter! Well done!

    :-)

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more