Results 1 to 13 of 13
-
07-20-2009, 07:05 PM #1Disabled
- Join Date
- Dec 2003
- Posts
- 1,941
Anyone think they will never master AJAX?
It sucks that so many good paying PHP jobs in my city yet you have to have experience with Javascript and AJAX. I tried reading books on them but I just suck and do not think I can ever memorize all of those functions. I easily memorized most PHP, mysql, HTML, and CSS which is capable of creating any site, but the fancy crap like flash and AJAX I do not think I will ever understand.
-
07-20-2009, 07:09 PM #2Web Hosting Master
- Join Date
- Sep 2006
- Location
- Cardiff - United Kingdom
- Posts
- 1,569
How complex are the books you are looking at? It always helps to start at the very start and go from there (seems obvious, but I've got one "beginner" PHP book which is quite complicated from the start - luckily I read the reviews and so purchased this more as an "intermediate" book)
Try and find a really basic AJAX article online. That's what I did. I know understand the basics and if I ever wanted (which I don't at the moment), I could build up from there.
It sure isn't easy though. You need a good, solid understanding of JS before going on. Once you can understand how the JS end functions, it's not too hard (all the PHP bit does is get the data via the $_GET vars, process them, and output back).
-
07-20-2009, 07:13 PM #3Disabled
- Join Date
- Dec 2003
- Posts
- 1,941
Yeah I searched Amazon for beginner books but they always start out with an example that a 3 year old can understand then suddenly jump to 200 line examples without explaining what the purpose of the functions are.
-
07-20-2009, 07:28 PM #4Web Hosting Master
- Join Date
- Sep 2006
- Location
- Cardiff - United Kingdom
- Posts
- 1,569
Okay I see what you mean. To be honest my level of AJAX isn't too high (probably around a 4 year old level ), I guess it's just about searching around online to find an article that explains AJAX in a lot of depth and going from there.
It's really not easy though, higher level AJAX confuses me a lot (whilst I'm quite happy with higher level PHP and all)
-
07-20-2009, 10:10 PM #5Virtually Flawless ;)
- Join Date
- Apr 2009
- Location
- USA / UK
- Posts
- 4,577
I know I'll never master all of JavaScript and AJAX.
To prove it I will now share with you my complete AJAX knowledge:
The function library:
Code:/* ajax.js * uses javascript to seamlessly * request another page from an * existing page without refresh. * takes a url to get and an element id * the get must be under the same domain * as the page for security reasons. * If ajax doesn't work, the 'get' is * put in the page as a simple "click here" * link, unless innerHTML doesn't work, in * which case the requesting page won't change. * This function is one-liner safe :) */ function ajax(get,divid) { var xmlHttp; try { /* Firefox, Opera 8.0+, Safari */ xmlHttp=new XMLHttpRequest(); } catch(e) { /* Internet Explorer */ try { /* Internet Explorer 6.0+ */ xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) { try { /* Internet Explorer 5.5+ */ xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) { document.getElementById(divid).innerHTML='<a href="'+get+'">Click Here</a>'; return false; } } } xmlHttp.onreadystatechange=function() { if(xmlHttp.readyState==4) { document.getElementById(divid).innerHTML=xmlHttp.responseText; } }; xmlHttp.open('GET',get,true); xmlHttp.send(null); }
Code:<div id="ajaxy">some default stuff here</div> <script type="text/javascript">ajax('/url/to/include.html','ajaxy');</script>
→ RAM Host -- USA Premium & Budget Linux Hosting
█ Featuring Powerful cPanel Shared Hosting
█ & Premium Virtual Dedicated Servers
→ Follow us on Twitter
-
07-20-2009, 10:28 PM #6Web Hosting Master
- Join Date
- Apr 2009
- Location
- Pittsburgh, Pennsylvania
- Posts
- 583
Look at a couple of the ajax frameworks.. pick one.. learn it.
http://www.prototypejs.org/
http://mootools.net/
http://jquery.com/
-
07-20-2009, 10:39 PM #7Junior Guru Wannabe
- Join Date
- Aug 2007
- Location
- Brighton, UK
- Posts
- 66
I'd recommend prototype.. you don't need to memorize hundreds of functions, just one:
Ajax.Updater('divname','/url',{optional arguments});
Easy.. If you're finding AJAX hard, you're probably doing it wrong. It's really not.
-
07-20-2009, 10:39 PM #8Disabled
- Join Date
- Sep 2005
- Location
- A box
- Posts
- 2,051
I'll never master it, its evolving to quickly
-
07-20-2009, 10:46 PM #9Web Hosting Master
- Join Date
- Apr 2009
- Location
- Pittsburgh, Pennsylvania
- Posts
- 583
I personally prefer jquery.. but i would honestly look at multiple and chose one for your taste. It's not hard to learn, just a little reading and patience.
-
07-20-2009, 10:53 PM #10Junior Guru Wannabe
- Join Date
- Aug 2007
- Location
- Brighton, UK
- Posts
- 66
To be honest JQuery definitely seems to be the way a lot of people are going these days - it's definitely on my to-learn list. Either way the important point is to pick a framework and learn it - once you do AJAX all starts to seem very easy - in some cases even easier than doing things the old-fashioned way.
-
07-20-2009, 11:35 PM #11Web Hosting Master
- Join Date
- Jan 2008
- Location
- St. John's, NL
- Posts
- 2,201
I've stayed away from AJAX as much as possible, as it seems to be one hack after another (then again, JavaScript is a hack in and of itself it seems).
Cpanel/WHM • PHP • Perl • Ruby • Full Time Support
LCWSoft - Canada web hosting (based in Newfoundland) since 2007
Servers based in the US and Canada (Uptime Report)
-
07-20-2009, 11:38 PM #12Junior Guru Wannabe
- Join Date
- Aug 2007
- Location
- Brighton, UK
- Posts
- 66
larwilliams: that's the benefit of using a framework like JQuery or Prototype; they do all the hacking for you, leaving you to write lovely clean code. I hate a hack as much as the next programmer and I used to hate Javascript for exactly that reason, but then I learned prototype and realised that modern Javascript programmers don't do hacks anymore. The only hacks I've done recently have been CSS hacks for IE6, and that's something you have to do whether you use JS or not.
-
07-20-2009, 11:51 PM #13Web Hosting Master
- Join Date
- Jan 2008
- Location
- St. John's, NL
- Posts
- 2,201
Cpanel/WHM • PHP • Perl • Ruby • Full Time Support
LCWSoft - Canada web hosting (based in Newfoundland) since 2007
Servers based in the US and Canada (Uptime Report)
Similar Threads
-
MinTyro - Cheap Cpanel, WHM, Master Reseller, Alpha Master Reseller
By shuga808 in forum Reseller Hosting OffersReplies: 3Last Post: 07-11-2009, 05:28 AM -
FREE Ajax Arcade Script - ArcademSX -Highscores, Profiles, 10000+ games, AJAX admin +
By jquindlen in forum Software & Scripts OffersReplies: 0Last Post: 06-26-2009, 08:26 PM -
Need ASP.NET AJAX SQL
By daniel76 in forum Web HostingReplies: 10Last Post: 10-09-2008, 09:55 PM -
Using Ajax and PHP?
By wayiran in forum Programming DiscussionReplies: 4Last Post: 07-19-2006, 11:28 AM