ajax

 
    • schi said...
    • User
    • 7 Oct 2005, 23:37

    ajax

    Have ya used or played with AJAX? I'm just curious :)

    • plodtv said...
    • User
    • 7 Jan 2006, 10:08

    I've had a little look

    I played a bit with the stuff that Rasmus posted on the php mailing list here. Not really played with any toolkits, but mostly because of time.

    • schi said...
    • User
    • 13 Jan 2006, 11:30
    wow, imho very nice example - really easy to understand. thx :)
    i've tried some of those big ajax-based-frameworks, but that's not for me - to big and to complicated...

  • I think it looks interesting, but until Opera supports it fully I will decline looking into it overmuch.

    My Sites: personal site | blog | my pastebin
    Other links: Slackware | Firefox
    • jshpro2 said...
    • User
    • 24 Jan 2006, 23:47
    FYI opera does support the xmlhttpd request object, but there's often problems with IE's proprietary implementation of it, and opera masks itself as IE, Rasmus's code in the 30 second ajax tutorial uses the user-agent string which falsely identified opera as IE.

    Not to mention there are problems with mac, etc... your best bet is to stick with Iframes until microsoft shapes up (yeah right) and decides to follow open standards. Of course your application should always gracefully degrade, that is it should work with or without javascript (notice gmail has a "html" link at the bottom for javascript disabled browsers?)

  • Well, tbh I find that fairly strange, to blame IE for Opera masking itself as IE? Fx can run AJAX without problems and I can't see how it is IE's fault that Opera can't. They are seperate browsers to link their problems makes little or no sense to me.

    My Sites: personal site | blog | my pastebin
    Other links: Slackware | Firefox
    • jshpro2 said...
    • User
    • 25 Jan 2006, 03:14
    You have misunderstood me,

    IE has a proprietary http request object.


    Here's how you should create the object

    if (window.XMLHttpRequest) {
    return new XMLHttpRequest();
    } else if (window.ActiveXObject) {
    return new ActiveXObject('Microsoft.XMLHTTP')
    } else {
    alert("Browser not compatible");
    return null;
    }


    And here's Rasmus' version


    var ro;
    var browser = navigator.appName;
    if(browser == "Microsoft Internet Explorer"){
    ro = new ActiveXObject("Microsoft.XMLHTTP");
    }else{
    ro = new XMLHttpRequest();
    }
    return ro;


    The XMLHttpRequest is for every mainstream browser, the Microsoft.XMLHTTP active X control is IE specific and not part of the open standards. The reason the XMLHttpRequest object does not work in opera is generally because instead of creating the object with the code I posted above, they are depending on the user-agent. The reason Opera is masking their user-agent is the MSN website blocked out Opera, showing the error message "your browser is not compatible with our website":
    Source = http://www.opera.com/pressreleases/en/2001/11/20011101.dml

    Fx cannot run AJAX, neither can any other browser because AJAX isn't something to run, it's an acronym describing a technique of manifesting JavaScript.

    See wikipedia:
    Like DHTML, LAMP, or SPA, Ajax is not a technology in itself, but a term that refers to the use of a group of technologies together. In fact, derivative/composite technologies based substantially upon Ajax, such as AFLAX, are already appearing.

    No-where did I blame IE for Opera not working with the httpRequest object, yes the problems are linked, yes it's Operas fault for masking their user-agent which was the result of a provocation which is in turn MSN's fault.

  • Ok, you were just a bit unclear in your other post.

    Also, you don't have to take every word I say literally >_>

    My Sites: personal site | blog | my pastebin
    Other links: Slackware | Firefox
    • jshpro2 said...
    • User
    • 25 Jan 2006, 20:13
    Also, you don't have to take every word I say literally >_>

    YES I DO !!!

    (Sorry for the confusion about IE)

    • plodtv said...
    • User
    • 26 Jan 2006, 19:53
    i think rasmus' post was more about how simple it is beyond the hype thats surrounding the buzzword

  • IE 7 xmlhttprequest support

    The other day someone posted in the IE blog http://blogs.msdn.com/ie/ that IE 7 will support xmlhttprequest natively, even when ActiveX is disabled. You'll be able to create an xmlhttprequest object the same way as in other browsers.

    • jshpro2 said...
    • User
    • 28 Jan 2006, 05:33
    That's cool, but if don't want your application to fall apart in [a lot of?] older browsers you still need to use iframes for maximum compatibility

    • plodtv said...
    • User
    • 28 Jan 2006, 14:29

    depends totally on the web application

    if you are using ajax for an admin interface of an intranet, you can be sure that everyone has browser a, its all about target audience, I agree if you are using AJAX for a public project then you need to think about what happens to people without browser capabilities.

    • jshpro2 said...
    • User
    • 29 Jan 2006, 01:14
    So you're saying it's impossible to have an admin on your web site that uses a slightly outdated version of IE, or certain version of IE on the mac? The only acceptable way to use javascript at all in my opinion is in a way that degrades gracefully. Period. Although sometimes yes for small admin panels I break my own rules, but I have run into problems that way as well.

  • Partly agree, partly disagree.

    I do believe that having a system that degrades gracefully is a requirement in any work that will be released or that is commercial. BUT I think that when working for yourself the only standards you should work to are the ones you set yourself. If you want flashy gizmos then you are more than entitled to use them. That's what I think anyway.

    My Sites: personal site | blog | my pastebin
    Other links: Slackware | Firefox
    • plodtv said...
    • User
    • 15 Feb 2006, 22:54

    Re:

    Quoth jshpro2:
    So you're saying it's impossible to have an admin on your web site that uses a slightly outdated version of IE, or certain version of IE on the mac? The only acceptable way to use javascript at all in my opinion is in a way that degrades gracefully. Period. Although sometimes yes for small admin panels I break my own rules, but I have run into problems that way as well.


    No i'm saying its impossible for people on an intranet that i run to be using any other browser than one I allow them to use.

    • nungana said...
    • User
    • 3 Apr 2006, 18:48

    Re:

    Quoth PsychoticDude85:
    Partly agree, partly disagree.

    I do believe that having a system that degrades gracefully is a requirement in any work that will be released or that is commercial. BUT I think that when working for yourself the only standards you should work to are the ones you set yourself. If you want flashy gizmos then you are more than entitled to use them. That's what I think anyway.


    Yes and no, I think. For example, there is no point in supporting IE older than 5.5. Whoever uses IE that predates 5.5 probably isn't visiting a website which uses AJAX. Legacy support is always an issue, but at some point you have to stop supporting legacy browsers. It's just a question where to stop supporting legacy browsers.

  • http://code.google.com/webtoolkit/

    There's google's way of doing ajax, and it's supposed to be automatically cross browser. The only problem is the fact that you have to create it using Java, which is then turned into javascript. I plan on trying to figure that out, cuz javascript is the devil, IMO.

    • nungana said...
    • User
    • 7 Jun 2006, 21:36

    Re:

    Quoth bradlis7:
    http://code.google.com/webtoolkit/

    There's google's way of doing ajax, and it's supposed to be automatically cross browser. The only problem is the fact that you have to create it using Java, which is then turned into javascript. I plan on trying to figure that out, cuz javascript is the devil, IMO.


    Javascript is only the devil if you don't know how to write javascript. The devil is making sure it works in all browsers. The google toolkit is neat and all.. but there are many other toolkits out there that deserve equal attention when deciding on which toolkit to develop with. Working with some simple javascript to implement ajax without using a toolkit is a good way to start out, especially if you don't plan on heavy usage of ajax in your site. You don't need a toolkit to make simple http requests to update one section of your page.

  • Crossbrowser Junk

    Well, the reason why I think it's the devil is because of cross browser incompatibility. It would be a lot easier if there was a decent site for javascript reference w/o all the ads that are in the way.

    • nungana said...
    • User
    • 10 Jun 2006, 00:46

    Learn to search..

    Crossbrowser incompatabilities are not the fault of Javascript, but instead the fault of browsers implementation of Javascript (namely the shortcommings of Safari and IE.) I'm not sure which site you're using for your javascript reference, but here are three good resources: Core JavaScript 1.5 Reference from Mozilla Developers Network,Gecko DOM Reference from MDN, and to get things working in IE there's the MSDN HTML and DHTML Reference

    Remember.. Search engines are there for a reason..

  • Sorry

    Ok, well you made me feel stupid for not looking this up myself. I've seen the ones from Mozilla, but I never knew about the microsoft ones.

    I'm mainly just complaining because I can, but I'll stop now. Thanks for the help.

    • X-T-C said...
    • User
    • 13 Jun 2006, 23:09
    I keep planning to try playing with it but put it off because I'm not fluent in JavaScript.

    • cursief said...
    • User
    • 26 Jul 2006, 18:29

    don't need to be a wizz at javascript

    X-T-C said:
    I keep planning to try playing with it but put it off because I'm not fluent in JavaScript.


    You really do not need to be a wizard in Javascript to enjoy "Ajax". You need about 2 good functions in javascript and that's it!

    It's quite funny the whole hype around Ajax since it's not really difficult to get it working! It's just a fancy name for loading dynamic elements on a webpage.

    I think it's fair to say you can do things with it only Flash could do before someone found out you could do this with HTML/PHP/Javascript too. (Well that statement will get a lot of comments hahaha)

    I might sound negative, but I actually really like "Ajax" in many ways. I do not however use X as in XML, I usually push back HTML to dynamic elements saves a lot of hassle parsing XML back to HTML.

    My recommendation is: Find a good Requester (The one described in this thread by jshpro2 for instance and play with it! You'll soon find it's easy and lot's of fun!!

  • JHR is what I've heard for AJAX minus XML, also quite a few people I've seen have been using JSON over XML now. Not sure on the merits of each since I'm not really used to either but someone more knowledgable may be able to clarify their uses.

    My Sites: personal site | blog | my pastebin
    Other links: Slackware | Firefox
Anonymous users may not post messages. Please log in or create an account to post in the forums.