www.webdeveloper.com
Page 2 of 2 FirstFirst 12
Results 16 to 24 of 24

Thread: What is AJAX... the big picture

  1. #16
    Join Date
    Dec 2013
    Posts
    21
    Well no, you are not getting your hopes too high. All of the technology exists to accomplish your goals.

    In general, you would use 'events' to trigger reading or writing on the server. These events are either user triggered(clicking on a button, for instance) or time-based(interval timer).

    I suspect that when you say 'device', you may be trying to communicate with an embedded webserver which usually have limited capabilities as far as server-side scripting. So, you would need to understand the commands that are needed to perform various operations on the server and simply use those commands (probably CGI type) within your Javascript/AJAX code. If you are targeting standard PC based servers like Apache or IIS, then you will have all sorts of PHP, ASP commands available on the server.

  2. #17
    Join Date
    Jun 2004
    Location
    Tampa, Florida
    Posts
    77
    OK! So as the devil is in the details, let me now consider some of those server side requirements. As it turns out my background has been in the world of automation, including remote control and data acquisition, and has also been very tied to the intel world. Everything from little embedded machines with 386ex CPUs, and no OS (unless I wrote one) to modern windows machines. So just to cut my learning curve I likely would be working with a PC based server. Unfortunately my background has also left me with a lot of tunnel vision, having worked mostly with custom applications.

    So as you can likely tell, I'm trying to mentally navigate replacing parts of such systems, where everything is a custom app, to systems where the custom work is concentrated where its really needed. So now that I'm seeing where browser based control panel displays can interact with a server side database via AJAX, I assume that whether it is done via timed poling or events, I could both pull and push data from and to that database, correct? So if that's true, and the database can be PC based, it remains now for me to first consider what database would be best, and to educate myself as to what server side apps and coding would need to be done, to complete the data flow between to that database. Next I'd be looking at the PC apps that would do the device communication, using the database as a kind of middle-man data pool.

    on that last point, I still have a lot of education to catch up on, especially about database interaction. Heck, the last time I wrote code to directly interface with a database it was a Microsoft ACcess database, and I'm reasonably sure I'd be better off these days working with something my mySQL or maybe postgGess?

    But there I'm getting ahead of myself... I'm intentionally working backwards, from a javascript based control panel to database interaction via AJAX. So the next question to ask is how much "from scratch" server side work is needed to go between the web server and and the database. Here I'm hoping, in the same spirit of getting away from re-inventing wheels, that this functionality is already available as an extension of some PC based databases? It would be nice to think that for simple things like pulling/pushing numerical or boolean values would be more about configuration and mapping then scratch building code. But again, maybe my hopes are too high there?

    I'm definitely not allergic to coding or even working with languages new to me, I just know I've re-invented way too many wheels in my life. As a now out of work programmer and electronics guy whose skills are constantly becoming obsolete or at least dated, this kind of assist in understanding newer technology I can put to use right "out of the box" is very much appreciated.

  3. #18
    Join Date
    Dec 2013
    Posts
    21
    We all need to learn new technology on a regular basis or we soon fall behind. I would suggest that you learn more about Javascript, HTML and PHP technologies. There are many excellent tuturials online for free that you can go through. One that I particularly like is the W3C schools -> http://www.w3schools.com

    They have tons and tons of good material and tutorials in many different areas. You just need to take the initiative to learn from them All you need is a PC and time (you said you were out of work...well, you just found something to occupy your time:-). Best wishes to you as you dig in and learn.

  4. #19
    Join Date
    Jun 2004
    Location
    Tampa, Florida
    Posts
    77
    Thanks! Well Javascript, HTML, and CSS were things I had become reasonably proficient in, and it sounds like the newer tools and browser evolution have made dealing with the different DOMs easier. So I hopefully have a head start there, and I do intend to dig in a lot more in the coming months. Thanks for the link too. It doesn't seem to have an AJAX area, but I'll find something.

    As you can surely understand though, I've been bitten enough times by bad assumptions. So now I start by explaining the goals and functionality I want to achieve, and ask ahead of time what tools to explore to get there. You know how it is!!! These days one can easily talk themselves into believing some new technology (AJAX in this case) will help them toward a goal, only to find out I'm barking up the wrong tree. :-)

  5. #20
    Join Date
    Dec 2013
    Posts
    21
    I am not sure why you think W3schools does not have an AJAX tutorial. I found it quite easily and it is excellent -> http://www.w3schools.com/ajax/default.asp

  6. #21
    Join Date
    Jun 2004
    Location
    Tampa, Florida
    Posts
    77
    I found it. Tunnel vision. :-\

    Question... is Ajax functionality obtained from a standard library, like a JS file, that you have to link your pages to in order to use, and if so where should I get it, and is it free, open source, or a commercial product?

  7. #22
    Join Date
    Dec 2013
    Posts
    21
    AJAX functionality is primarily included in the ECMAScript language and executed by the JS engine in the browser so it is free. In your case, the primary function needed is "XMLHttpRequest". That will allow you to Get and Post data to/from the server as needed. Do some research on that function to understand how it executes in your JS.

  8. #23
    Join Date
    Jan 2014
    Location
    Calgary, Canada
    Posts
    29
    AAJAX is a technique for creating fast and dynamic web pages.

    AJAX allows web pages to be updated asynchronously by exchanging small amounts of data with the server behind the scenes. This means that it is possible to update parts of a web page, without reloading the whole page.

    Classic web pages, (which do not use AJAX) must reload the entire page if the content should change.

    Examples of applications using AJAX: Google Maps, Gmail, Youtube, and Facebook tabs.

  9. #24
    Join Date
    Jun 2004
    Location
    Tampa, Florida
    Posts
    77
    Well I'm very interested in the the part about being able to exchange data with a server, because it means a database could become a link between software communicating with real devices, and updates to a web page. But I don't understand the continued references to classic web pages needing to re-load pages to update regions. Again, despite the fact that this code is so old it only works in IE now, I did throw it together over a dozen years ago. It simulates a control panel for an electric utility substation, and illustrates the ability to update numerical values without reloading the page, and even change the breaker graphic (just blinking currently) when you click, without re-loading.

    http://elfintechnologies.com/html_hmi/hmi_tst1.htm

    That was done way back when IE was version 4, and so was the early Mozilla (Netscape) browser. And really, I had seem more sophisticated programmers use ordinary javascript to run much more complex animations, swapping out all kinds of page content without re-loading the page.

    The probalem, of course, is that every new browser version would break the code, because the DOM kept changing. So maybe the main thing with AJAX is that it will work with ANY browser, on any DOM? If not, its not a huge improvement really.

    Now the part about exchanging data directly with a server... THAT is VERY interesting!! :-)

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles