Alex Tech Adventures The webs best tutorials!

Error
  • Could not match ripper response
    URL: http://www.blip.tv/file/2764251
    Response: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!--[if IE 8]> <html class="ie8" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" xmlns:og="http://ogp.me/ns#" xmlns:fb="http://www.facebook.com/2008/fbml"> <![endif]--> <!--[if gt IE 8]><!--> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" xmlns:og="http://ogp.me/ns#" xmlns:fb="http://www.facebook.com/2008/fbml"> <!--<![endif]--> <head prefix="og: http://ogp.me/ns# bliptvviewer: http://ogp.me/ns/apps/bliptvviewer#"> <!--chartbeat timer--> <script type="text/javascript">var _sf_startpt=(new Date()).getTime()</script> <meta name="fb_channel_url" value="http://a.blip.tv/channel.html" /> <script type="text/javascript" src="http://a.blip.tv/scripts/BLIP/DestinationAnalytics.f8549cc.js"></script> <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setAccount', 'UA-713068-1']); _Analytics.addVariables({"analytics":[[1,"template","lite-episode","3"],[2,"series name","zendtutorials","3"],[3,"QR","0","3"]]}); _Analytics.setVariables(); (function() { var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); </script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script> <!-- rss--> <link rel="alternate" type="application/rss+xml" title="RSS Feed for zf 14 ajax request" href="/rss/flash/2784124" /> <link rel="stylesheet" type="text/css" href="http://a.blip.tv/skin/smooth/reset.f8549cc.css" media="screen" /> <link rel="stylesheet" type="text/css" href="http://a.blip.tv/skin/smooth/common.f8549cc.css" /> <link rel="stylesheet" type="text/css" href="http://a.blip.tv/skin/smooth/episodePage.f8549cc.css" /> <link rel="stylesheet" type="text/css" href="http://a.blip.tv/skin/smooth/playerControls.f8549cc.css" /> <link rel="stylesheet" type="text/css" href="http://a.blip.tv/skin/smooth/endcap.f8549cc.css" /> <!-- Meta Tags --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>zf 14 ajax request | zendtutorials on Blip</title> <meta name="description" content="Prepare controller to accept AJAX request using action context switcher action helper. Will generate JSON object which is picked up by jQuery front-end and applied to the page."/> <meta name="keywords" content="zendtutorials"/> <meta name="keywords" content="zendtutorials blip"/> <meta name="keywords" content="zend framework"/> <meta name="keywords" content="ajax"/> <meta name="keywords" content="jquery"/> <!-- FB Open Graph Tags --> <meta property="fb:app_id" content="136482209767138"/> <meta property="og:type" content="bliptvviewer:web_series_episode"/> <meta property="og:title" content="zf 14 ajax request - zendtutorials on Blip"/> <meta property="og:image" content="http://a.images.blip.tv/Tmth-zf14AjaxRequest135-390.jpg"/> <meta property="og:description" content="Prepare controller to accept AJAX request using action context switcher action helper. Will generate JSON object which is picked up by jQuery front-end and applied to the page."/> <meta property="og:locale" content="en_US"/> <!-- <meta property="bliptvviewer:series" content="zendtutorials"/> <meta property="bliptvviewer:release_date" content="1256424392"/> <meta property="bliptvviewer:duration" content="2225"/> <meta property="bliptvviewer:category" content="Tech & Gadgets"/> <meta property="bliptvviewer:show_page" content="http://blip.tv/zendtutorials"/> --> <meta property="og:url" content="http://blip.tv/zendtutorials/zf-14-ajax-request-2784124"/> <meta property="og:site_name" content="Blip"/> <meta property="og:video" content="http://blip.tv/play/AYGp92AD"/> <meta property="og:video:type" content="application/x-shockwave-flash"/> <meta property="og:video:secure_url" content="https://blip.tv/play/AYGp92AD"/> <meta name="robots" content="all" /> <script type="text/javascript" src="http://a.blip.tv/scripts/BLIP/DestinationEpisode.f8549cc.js"></script> <script> var loaded = (new Date()).valueOf(); </script> </head> <body> <div id="Header" class="clearfix"> <div id="HeaderContents" class="clearfix"> <h1 class="Logo"> <a href="/" alt="Blip" title="Blip Home"> <span>Blip</span> </a> </h1> <div class="SearchAndNav"> <div class="Browse HoverDropDown"> <div class="BrowseButton HeaderCaption"> <div class="BrowseButtonShadow"></div> <a class="BrowseButtonLink"> <span>Browse</span> <span class="DropDownArrow Icon"></span> </a> </div> <div class="ChannelList clearfix"> <ul class="List"> <li><a href="/animation-and-comics-videos">Animation & Comics</a></li> <li><a href="/comedy-videos">Comedy</a></li> <li><a href="/drama-videos">Drama</a></li> <li><a href="/celebrity-entertainment-news-videos">Entertainment</a></li> <li><a href="/fashion-and-beauty-videos">Fashion & Beauty</a></li> <li><a href="/food-drink-and-travel-videos">Food & Drink</a></li> <li><a href="/health-and-fitness-videos">Health & Fitness</a></li> <li><a href="/home-and-family-videos">Home & Family</a></li> <li><a href="/diy-how-to-videos">How To</a></li> <li><a href="/education-documentary-videos">Learning</a></li> <li><a href="/music-videos">Music</a></li> <li><a href="/news-money-and-politics-videos">News & Politics</a></li> <li><a href="/sports-and-cars-videos">Sports & Cars</a></li> <li><a href="/talk-and-interview-shows-videos">Talk & Interview</a></li> <li><a href="/apps-tech-and-gadgets-videos">Tech & Gadgets</a></li> <li><a href="/videogames-videos">Videogames</a></li> </ul> </div> </div> <form class="SearchHeader clearfix" method="get" action="/search"> <span class="Icon SearchIcon"></span> <input type="text" name="q" class="SearchTerms" autocomplete="off"/> </form> <div class="Subscriptions"> <a class="FacebookLoginButton" id="FacebookLoginButton" title="Log in with Facebook"> </a> <span class="Indicator"></span> <a class="LearnAboutSubscriptions" href="/subscriptions/start-subscribing"> About subscriptions </a> </div> </div> </div> </div> <div id="PageInfo" data-posts-id="2784124" data-users-id="418265" data-ad-sales-categories="Tech,Screencast" data-core-value="0" data-admin-rating="1" data-lock="0" style="display:none !important;"></div> <div class="EpisodeLite" id="Content"> <div id="TheaterLiteContainer" class="clearfix"> <div id="TheaterLite" class="clearfix"> <h2> zf 14 ajax request </h2> <h3> <a href="/zendtutorials"> zendtutorials </a> </h3> <div class="clearfix"></div> <div class="VideoPlayer clearfix"> <div class="EpisodeList"> <h3>Best of Blip</h3> <div class="EpisodeListContents" style="overflow: hidden;"> <ul class="Scrollable"> <li data-episode-uri="/profootballweekly/no-pressure-5934100" class="clearfix"> <a class="EpisodeThumbnail" href="/profootballweekly/no-pressure-5934100"> <img src="http://3.i.blip.tv/g?src=Profootballweekly-NoPressure553-547.jpg&w=100&h=56&bc=000000&fmt=jpg" width="100" height="56" /> </a> <div class="EpisodeListItemWrapper"> <h4> <a href="/profootballweekly/no-pressure-5934100"> No Pressure </a> </h4> <span class="From"> from </span> <a href="/profootballweekly">Pro Football Weekly</a> </div> </li> <li data-episode-uri="/seriousbusinessonbtr/ball-of-flame-shoot-fire-serious-business-on-btr-ep61-5929964" class="clearfix"> <a class="EpisodeThumbnail" href="/seriousbusinessonbtr/ball-of-flame-shoot-fire-serious-business-on-btr-ep61-5929964"> <img src="http://3.i.blip.tv/g?src=Seriousbusinessonbtr-25441204.png&w=100&h=56&bc=000000&fmt=jpg" width="100" height="56" /> </a> <div class="EpisodeListItemWrapper"> <h4> <a href="/seriousbusinessonbtr/ball-of-flame-shoot-fire-serious-business-on-btr-ep61-5929964"> Ball Of Flame Shoot Fire - Serious Business on BTR [ep61] </a> </h4> <span class="From"> from </span> <a href="/seriousbusinessonbtr">Serious Business on BTR</a> </div> </li> <li data-episode-uri="/the-louise-log/how-to-cope-with-war-on-a-video-set-the-louise-log-29-5927528" class="clearfix"> <a class="EpisodeThumbnail" href="/the-louise-log/how-to-cope-with-war-on-a-video-set-the-louise-log-29-5927528"> <img src="http://4.i.blip.tv/g?src=Anneflournoy-HowToCopeWithWarOnAVideoSetTheLouiseLog29615.jpg&w=100&h=56&bc=000000&fmt=jpg" width="100" height="56" /> </a> <div class="EpisodeListItemWrapper"> <h4> <a href="/the-louise-log/how-to-cope-with-war-on-a-video-set-the-louise-log-29-5927528"> How To Cope With War On A Video Set: The Louise Log #29 </a> </h4> <span class="From"> from </span> <a href="/the-louise-log">THE LOUISE LOG</a> </div> </li> <li data-episode-uri="/vampiremob/vampire-mob-episode-three-of-six-season-one-4063885" class="clearfix"> <a class="EpisodeThumbnail" href="/vampiremob/vampire-mob-episode-three-of-six-season-one-4063885"> <img src="http://0.i.blip.tv/g?src=VampireMob-VampireMobEpisodeThree665.jpg&w=100&h=56&bc=000000&fmt=jpg" width="100" height="56" /> </a> <div class="EpisodeListItemWrapper"> <h4> <a href="/vampiremob/vampire-mob-episode-three-of-six-season-one-4063885"> Vampire Mob Episode Three of Six (Season One) </a> </h4> <span class="From"> from </span> <a href="/vampiremob">Vampire Mob</a> </div> </li> <li data-episode-uri="/goodmythicalmorning/i-wear-women-s-deodorant-5921692" class="clearfix"> <a class="EpisodeThumbnail" href="/goodmythicalmorning/i-wear-women-s-deodorant-5921692"> <img src="http://5.i.blip.tv/g?src=GoodMythicalMorning-IWearWomensDeodorant899.jpg&w=100&h=56&bc=000000&fmt=jpg" width="100" height="56" /> </a> <div class="EpisodeListItemWrapper"> <h4> <a href="/goodmythicalmorning/i-wear-women-s-deodorant-5921692"> I Wear Women&#39s Deodorant </a> </h4> <span class="From"> from </span> <a href="/goodmythicalmorning">Good Mythical Morning</a> </div> </li> <li data-episode-uri="/watchhomeschooled/episode-4-so-wrong-but-so-right-5512525" class="clearfix"> <a class="EpisodeThumbnail" href="/watchhomeschooled/episode-4-so-wrong-but-so-right-5512525"> <img src="http://9.i.blip.tv/g?src=Watchhomeschooled-Episode4SoWrongButSoRight559.jpg&w=100&h=56&bc=000000&fmt=jpg" width="100" height="56" /> </a> <div class="EpisodeListItemWrapper"> <h4> <a href="/watchhomeschooled/episode-4-so-wrong-but-so-right-5512525"> Episode 4 - So Wrong, But So Right </a> </h4> <span class="From"> from </span> <a href="/watchhomeschooled">Homeschooled</a> </div> </li> <li data-episode-uri="/feminist-frequency/lego-gender-part-1-lego-friends-5921928" class="clearfix"> <a class="EpisodeThumbnail" href="/feminist-frequency/lego-gender-part-1-lego-friends-5921928"> <img src="http://8.i.blip.tv/g?src=Feministfrequency-LEGOGenderPart1LegoFriends946.jpg&w=100&h=56&bc=000000&fmt=jpg" width="100" height="56" /> </a> <div class="EpisodeListItemWrapper"> <h4> <a href="/feminist-frequency/lego-gender-part-1-lego-friends-5921928"> LEGO & Gender Part 1: Lego Friends </a> </h4> <span class="From"> from </span> <a href="/feminist-frequency">Feminist Frequency</a> </div> </li> <li data-episode-uri="/fashiontv/aqua-di-lara-swimwear-show-f-floor-disco-version-ftv-5912103" class="clearfix"> <a class="EpisodeThumbnail" href="/fashiontv/aqua-di-lara-swimwear-show-f-floor-disco-version-ftv-5912103"> <img src="http://8.i.blip.tv/g?src=Fashiontv-AquaDiLaraSwimwearShowFFloorDiscoVersionFTV163-26.jpg&w=100&h=56&bc=000000&fmt=jpg" width="100" height="56" /> </a> <div class="EpisodeListItemWrapper"> <h4> <a href="/fashiontv/aqua-di-lara-swimwear-show-f-floor-disco-version-ftv-5912103"> Aqua Di Lara Swimwear Show - F Floor Disco Version | FTV </a> </h4> <span class="From"> from </span> <a href="/fashiontv">Fashion TV</a> </div> </li> <li data-episode-uri="/complacent-charlie/episode-3-charlie-tries-to-relax-5329592" class="clearfix"> <a class="EpisodeThumbnail" href="/complacent-charlie/episode-3-charlie-tries-to-relax-5329592"> <img src="http://3.i.blip.tv/g?src=IAMCREATIVE-Episode3CharlieTriesToRelax443.png&w=100&h=56&bc=000000&fmt=jpg" width="100" height="56" /> </a> <div class="EpisodeListItemWrapper"> <h4> <a href="/complacent-charlie/episode-3-charlie-tries-to-relax-5329592"> Episode 3 - Charlie Tries to Relax </a> </h4> <span class="From"> from </span> <a href="/complacent-charlie">Complacent Charlie</a> </div> </li> <li data-episode-uri="/complacent-charlie/episode-2-charlie-watches-tv-5291741" class="clearfix"> <a class="EpisodeThumbnail" href="/complacent-charlie/episode-2-charlie-watches-tv-5291741"> <img src="http://7.i.blip.tv/g?src=IAMCREATIVE-Episode2CharlieWatchesTV270.png&w=100&h=56&bc=000000&fmt=jpg" width="100" height="56" /> </a> <div class="EpisodeListItemWrapper"> <h4> <a href="/complacent-charlie/episode-2-charlie-watches-tv-5291741"> Episode 2 - Charlie Watches TV </a> </h4> <span class="From"> from </span> <a href="/complacent-charlie">Complacent Charlie</a> </div> </li> <li data-episode-uri="/complacent-charlie/episode-1-charlie-in-the-drive-thru-5237172" class="clearfix"> <a class="EpisodeThumbnail" href="/complacent-charlie/episode-1-charlie-in-the-drive-thru-5237172"> <img src="http://8.i.blip.tv/g?src=IAMCREATIVE-Episode1CharlieInTheDriveThru977.png&w=100&h=56&bc=000000&fmt=jpg" width="100" height="56" /> </a> <div class="EpisodeListItemWrapper"> <h4> <a href="/complacent-charlie/episode-1-charlie-in-the-drive-thru-5237172"> Episode 1 - Charlie in the Drive-Thru </a> </h4> <span class="From"> from </span> <a href="/complacent-charlie">Complacent Charlie</a> </div> </li> <li data-episode-uri="/realwineshow/pinot-grigio-real-wine-episode-8-5919017" class="clearfix"> <a class="EpisodeThumbnail" href="/realwineshow/pinot-grigio-real-wine-episode-8-5919017"> <img src="http://8.i.blip.tv/g?src=Realwineshow-PinotGrigioRealWineEpisode8621.jpg&w=100&h=56&bc=000000&fmt=jpg" width="100" height="56" /> </a> <div class="EpisodeListItemWrapper"> <h4> <a href="/realwineshow/pinot-grigio-real-wine-episode-8-5919017"> Pinot Grigio - "Real Wine" Episode 8 </a> </h4> <span class="From"> from </span> <a href="/realwineshow">Real Wine</a> </div> </li> </ul> </div> </div> <div id="PlayerEmbed"> <div id="EmbedTarget"></div> <script> (function() { var embedder = new BLIP.Embedder.Embedder({ postsID : "2784124", swfLocation : "http://a.blip.tv/scripts/flash/stratos.swf", shoggLocation: "http://a.blip.tv/scripts/ShoggPlayer-min.js", siteURL : "http://blip.tv", width : "620", height : "350", target: 'PlayerEmbed', useShogg: true }); embedder.embed(); })(); </script> </div> <div class="EpisodeEndcapLite" data-src="/episode/get_endcap?users_id=418265&posts_id=2784124&no_wrap=1&esi=1&lite=1"></div> </div> </div> </div> <div id="SocialMediaSection" class="clearfix"> <ul> <li class="Share"><a rel="modal" data-modal-href="/episode/get_share_actions/2784124?no_wrap=1"> <span class="Icon ShareIcon"></span> Share </a></li> <li class="Comment"> <a> <span class="CommentCallout"> <span class="Icon CommentIcon"></span> <span class="CommentCount"></span> Comments </span> <span class="SampleComment"> <span class="Icon SampleCommentNub"></span> <span class="SampleCommentText"> </span> </span> </a> </li> <li class="Facebook"> <div class="FacebookLikeBox FacebookEpisodeLike" data-action="ep-facebook-like"> <fb:like class="" href="" send="false" width="300" height="35" show_faces="false" font="lucida grande" show_faces="false"></fb:like> </div> </li> </ul> <noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript> </div> <div class="Comments" id="disqus_thread" data-disqus-id="2784124" data-disqus-shortname="bliptv" data-disqus-developer="0"></div> <hr/> <!-- End Disqus Integration --> <div id="EpisodeDescriptionLite" class="clearfix"> <a class="ShowPoster" href="/zendtutorials"> <img src="http://a.blip.tv/skin/smooth/images/poster-none-available.png" /> </a> <div class="About"> <h2>About this episode</h2> <span class="ContentRating">TV-UN</span> <p> Prepare controller to accept AJAX request using action context switcher action helper. Will generate JSON object which is picked up by jQuery front-end and applied to the page. </p> <ul class="MetaDataPairs clearfix"> <li class="Channel"> <h3>Category</h3> <strong> <a href="/apps-tech-and-gadgets-videos">Tech & Gadgets</a> </strong> <strong> <a href="/diy-how-to-videos">How To</a> </strong> </li> <li> <h3>Release Date</h3> <h6>Oct 24, 2009</h6> </li> <li> <h3>Runtime</h3> <h6>37:05</h6> </li> </ul> </div> <div class="Advertisement"> <script src="http://31a2.v.fwmrm.net/ad/g/1?nw=10274&pvrn=12345&csid=apps-tech-and-gadgets-videos&resp=ad;pagetype=episode&showname=zendtutorials&postsId=2784124;slau=300x250_destination_display&ptgt=s&envp=g_js&slid=fw_showAdBlock&w=300&h=250" language="javascript"> </script> </div> </div> <div class="ConditionalScroll" data-url="/show/get_recommended_shows?users_id=418265&no_wrap=1&esi=1"></div> <div id="CommentLink"> <hr/> <a href="#SocialMediaSection"> <span class="Icon CommentIcon"></span> Have something to say? <strong>Comment on this video</strong> </a> </div> <hr/> </div> <div id="FooterWrap"> <ul id="Footer" class="clearfix"> <li class="Links"> <h5>Useful links</h5> <a href="/about">About Blip</a> <a href="http://theblog.blip.tv">Blog</a> <a href="/people">People</a> <a href="/contact">Contact</a> <a href="/principles">Principles</a> <a href="/careers">Careers</a> <a href="/advertise">Advertisers</a> <a href="http://press.blip.tv/">Press</a> <a href="/developers">Developers</a> <a href="/copyright">Copyright</a> <a href="/privacy">Privacy Policy</a> <a href="/terms">Terms of Use</a> </li> <li class="Producers"> <h5>For Producers</h5> <span>Want to create an awesome original web series on Blip?</span> <div class="ProducerButtons"> <a class="ProducerSignupFooter MinimalButton Highlight" href="/users/create">Join</a> <a class="ProducerTourFooter MinimalButton" href="/tour">Take a tour</a> </div> <span>If you're already producing an original series, login to access your dashboard.</span> <div class="ProducerButtons"> <a class="ProducerLoginFooter MinimalButton" href="/users/login">Log in</a> </div> </li> <li class="TwitterFooter"> <h5><span class="Icon TwitterIcon"></span>Blip on twitter</h5> <div class="TwitterFeed" data-twitter-name="bliptv"> <ul class="Feed"></ul> </div> <a href="http://twitter.com/bliptv">Follow Blip on Twitter</a> </li> <li class="FacebookFooter"> <h5><span class="Icon FacebookIcon"></span>Blip on Facebook</h5> <div class="FooterFacebookMessage clearfix"> <div class="FooterFacebookLikeButton"> <fb:like href="http://facebook.com/blip" layout="box_count" show_faces="false" width="50" font=""></fb:like> </div> If you like your original series spoon-fed, "Like" Blip for episode releases, industry news and behind-the-scenes footage. </div> <a href="http://facebook.com/blip">Follow Blip on Facebook</a> </li> </ul> <div id="FooterCopyright">Discover the best in original web series.<span class="Copyright">&copy; 2012 Blip Networks, Inc. All Rights Reserved.</span></div> </div> <script type="text/javascript"> setTimeout(function(){var a=document.createElement("script"); var b=document.getElementsByTagName('script')[0]; a.src=document.location.protocol+"//dnn506yrbagrg.cloudfront.net/pages/scripts/0011/8003.js"; a.async=true;a.type="text/javascript";b.parentNode.insertBefore(a,b)}, 100); </script> <script type="text/javascript"> /* this is pretty weird, and there's probably a better way to do it. #TODO fix and delete! document.write, bad. var browserVersion = navigator.appVersion; if(browserVersion.substring(5,11)=="iPhone"){ document.write("<div id=\"Navigation\">"); document.write("<a href=\"http://blip.tv/?skin=iphone\" class=\"LastLink\">Blip Mobile Site</a>"); document.write("</div>"); document.write("<div class=\"Clear\"></div>"); } */ </script> <!-- Begin comScore Tag --> <script> var _comscore = _comscore || []; _comscore.push({ c1: "2", c2: "6708843" }); (function() { var s = document.createElement("script"), el = document.getElementsByTagName("script")[0]; s.async = true; s.src = (document.location.protocol == "https:" ? "https://sb" : "http://b") + ".scorecardresearch.com/beacon.js"; el.parentNode.insertBefore(s, el); })(); </script> <noscript> <img src="http://b.scorecardresearch.com/p?c1=2&c2=6708843&cv=2.0&cj=1" /> </noscript> <!-- End comScore Tag --> <!-- Start Quantcast tag --> <script type="text/javascript"> _qoptions={ qacct:"p-74vRiZ03u2gFw" }; </script> <script type="text/javascript" src="http://edge.quantserve.com/quant.js"></script> <noscript> <img src="http://pixel.quantserve.com/pixel/p-74vRiZ03u2gFw.gif" style="display: none;" border="0" height="1" width="1" alt="Quantcast"/> </noscript> <!-- End Quantcast tag --> <script type="text/javascript"> var _sf_async_config={uid:15601,domain:"blip.tv"}; (function(){ function loadChartbeat() { window._sf_endpt=(new Date()).getTime(); var e = document.createElement('script'); e.setAttribute('language', 'javascript'); e.setAttribute('type', 'text/javascript'); e.setAttribute('src', (("https:" == document.location.protocol) ? "https://s3.amazonaws.com/" : "http://") + "static.chartbeat.com/js/chartbeat.js"); document.body.appendChild(e); } var oldonload = window.onload; window.onload = (typeof window.onload != 'function') ? loadChartbeat : function() { oldonload(); loadChartbeat(); }; })(); </script> <div id="SubscribeLoginModal" style="display:none;"> <div class="Shade"></div> <div class="Content"> <div class="Note"> We keep track of your subscriptions through your Facebook account. No additional registration required.<br/> Nothing will be posted to Facebook without your explicit permission. </div> </div> </div> </body> </html>
    Regex: setPostsId\s*\(\s*(\d+)\s*\)

AJAX requests with Zend Framework

(0 votes, average 0 out of 5)
AJAX requests in Zend Framework are no different than regular requests. You can call any controller/action from the background and it will give you an HTML response. However, you probably do not want the unnecessery code that layout and view scripts provide. You could, of course, create separate controllers and viewers specially for AJAX but that's repetitive code we obviously do not want. Manually switching off layout and view scripts on xmlHttp header detection is not pretty too. To the rescue comes action context switcher that detects the type of request sent and applies appropriate changes to te controller. Watch the video to see how to set it up.

But that is not enough. Once you got ZF to output the desired response, be it XML or JSON, you need to update your front end to accept that response and make sense out of it. In the video I show how you can grap JSON output with a response JavaScript function and put the variables in their right places on the page.


Key notes in the presentation:
  • Setting up action context switcher.
  • Creating links using ajaxLink view helper from ZendX_Jquery ...
  • ... that invoke the context switcher.
  • Review view script to make sure that only final variables are in the view.
  • Review view script's design for more comfortable jQuery manipulation.
  • Create a callback function in JavaScript that accepts JSON generated by context switcher and ...
  • ... applies variables from JSON to the appropriate sections of the page.

Mistake in frontend.js was noted by Yorian

In the video I have <div id="books"> in the loop JSON loop so each book entry becomes an accordion container on its own.  To fix that, need to take <div id="books"> outside of the loop.  I am also putting all HTML in a string and then appending it at the end becuase if you append <div id="books"> on its own, jQuery parses it as a complete HTML code and puts a self closing /> at the end so the rest of the code breaks.  I could, of course, append children but that too complex for this scenario:
1
2
3
4
5
6
7
8
9
10
11
function displayBooks(response){
	response = JSON.parse(response);
	$("#booksResponse").html('');
	var booksHtml = '<div id="books">';
	for(var i in response.books){
		booksHtml += '<h3><a href="#">'+response.books[i].title+'</a></h3><div>written by'+response.books[i].author+'</div>';
	}
	booksHtml += '</div>'
	$("#booksResponse").append(booksHtml);
	$("#booksResponse #books").accordion({"active":"none", "collapsible" : "true"});
}

 

Download soarce

Context Switcher
JSON
ZendX_JQuery ajaxLink

Last Updated ( Sunday, 25 October 2009 13:23 )  
Discuss (4 posts)
AJAX requests with Zend Framework
Nov 29 2010 02:53:37
You asked why the ajax links only work with a short open tag, i.e. s just hen nothing shows up. However I did a test and it works with either with o that is something that also needs to be checked before considering using short open tags, especially in a production environment.

Great tutorials! I might have to donate.
#785
AJAX requests with Zend Framework
Nov 29 2010 02:55:38
Wow, that last message didn't show up correctly. Basically "?=" is just "u'll run into problems.
#786
AJAX requests with Zend Framework
Nov 29 2010 02:56:55
Those last two messages didn't show up right. The short open tag is equivalent to php echo, not just php. Thanks for the tutorials.
#787
Re:AJAX requests with Zend Framework
Nov 29 2010 15:16:22
Yeah I probably wasn't thinking in right direction and tried to put complex code after ?=.

Thanks for reminding me that.
#788

You need to login or register to post comments.
Discuss...
You are here: Home Development Zend Framework AJAX requests with Zend Framework

Statistics

Members : 1388
Content : 42
Web Links : 1
Content View Hits : 190501

Poll

Interested in TinyBrowser and TinyMce plugin for ZF?
 

Who's Online

We have 31 guests online