What would be the best place to start learning AJAX (I have Perl as a backend)

I am currently developing a website using basic cgi to display pages. I would like the website to be modified to have a better (readable dynamic) interface.

What methods (if not AJAX) and / or tutorials would you recommend me to start?

+4
source share
14 answers

AJAX is best picked up by picking up the following:

Once you have those under your belt, you can make an informed decision about which API or framework you want to use. The internal interface is not a big deal, but I recommend using JSON as your XML select protocol. XML parsing is fraught with inconsistency, which requires code hacks to work. JSON is much simpler.

See my answer on the topic. Has anyone migrated from Struts 1 to another web infrastructure? "for more information.

+11
source

The term "AJAX" is a little misleading and can easily confuse people trying to master it. The term itself really only refers to asynchronously retrieving or sending data from the server (i.e. without reloading the page), but it is usually used to describe any modern system saturated with Javascript. (In fact, even when you talk about receiving or sending data asynchronously, the term “AJAX” is not entirely correct - it was originally coined to mean “asynchronous Javascript and XML,” but most modern implementations use JSON instead of XML).

So, I suspect that you are actually talking about “modern Javascript”. Using Javascript on a website (as noted earlier) involves several related but different technologies, and is very useful when you begin to understand what it is, where they start and end, and how they interact.

First you have the Javascript language itself. Although there are several implementations, it is actually relatively simple, and you should have no problem finding the syntax.

Then there is the DOM or document object model. This is the Javascript-based browser interface for the page itself. The DOM is actually quite complicated compared to the Javascript language, and most likely this is the place where you have the most problems (not least because the DOM provided by different browsers tends to be slightly different).

To really start learning this stuff, I suggest you start by looking at the basic DOM manipulation. Learn how to dynamically create elements using the DOM, how to assign events, how your code interacts with the page, etc. The Internet has a huge amount of resources for viewing and several books. As already mentioned, O'Reilly Javascript: A complete guide is a great resource. If you need a reliable web resource, try the PPK website . You will also want to install Firebug - this is extremely useful for debugging. It also makes a great learning tool, you can open the console and play with any page you want. The DOM browser and tab completion make this very easy.

You can start by looking at Javascript separately, but simply enough so that you probably pick up everything you need just by looking at a few examples. Instead, I would suggest that you go back to the Javascript language as you progress. Learn about its prototyping of objects (and how it differs from the more traditional OOP classes that you may be used to). These concepts may take some time to “click” with some people, and you don’t need to know this when you start, so I would recommend painting it.

Please note that I have not mentioned AJAX or any frameworks yet - it will be much easier for you if you have basic knowledge in Javascript and DOM before you start looking for a framework. When it comes to manipulating the DOM, these platforms simply provide shortcuts and utility functions - if you don't know what it does behind the scenes, solving any problems can be very difficult.

I would also recommend using the infrastructure to handle AJAX complexities simply because (unlike manipulating the DOM and event processing) you have very few reasons to understand the complexities of XMLHttpRequest if you really don't want to. Let the environment take care of this and all browser compatibility issues.

Good luck

+15
source
+5
source

I offer jQuery, lightweight and very simple to handle quickly, a great irc and web community. For ajax, it is as simple as $ .ajax (url, callbackFn); - http://docs.jquery.com/Ajax

Good tutorials at www.learningjquery.com

+3
source

There are many good answers here about teaching AJAX (or JavaScript / DOM) as a separate entity, but CPAN's CGI :: AJAX module is the fastest and easiest way to set yourself up for a web page that uses AJAX to refresh the page on the fly. using a perl server. It does not require knowledge of the DOM, XML, JSON, or any other language except Perl, a little HTML, and the brightest hint of JavaScript.

All you have to do is assign a JavaScript event handler (for example, onkeyup = '...'), specifying which Perl function to call and what data to provide as input, and create a div to receive the output. CGI :: AJAX will handle all server communication and DOM manipulation for you.

+3
source

I find that W3 Schools textbooks are always a good place to start before going to more in-depth lessons.

http://www.w3schools.com/ajax/default.asp

+2
source

If you're a little new to JavaScript, you should probably start using the framework.

Jquery is easy and enjoyable and has good tutorials and documentation .

+1
source

If you really want to understand what you are doing, JavaScript: a complete guide is a great reference for learning JavaScript, which has a section on how XMLHttpRequest works and what problems arise when using a cross browser ..

Once you understand this, look at using a framework like jQuery or Prototype, which will take care of the hard work for you.

+1
source

I would recommend the book Head Rush Ajax from Head First Labs .

He will guide you through the process of learning Ajax from scratch.

They make minimal assumptions about what you may or may not know yet.

The author does a good job of introducing building blocks for understanding and using AJAX.

Yours faithfully...

+1
source

It is best to start with a Javascript library that provides a reasonable interface for AJAX, such as Prototype. There are many resources for learning the basics of such libraries. For example: http://www.prototypejs.org/learn

0
source

How about learning jQuery ?

0
source

If you no longer want to immerse yourself in nuts and bolts, the TIBCO common interface . It is free, open source and runs on Tomcat. GI is an AJAX-based IDE that runs in a browser and is used to create AJAX websites.

I do not work for TIBCO and just trying to help. If you had to pay for a tool, I probably would not have offered it.

-Steven

0
source
0
source

I got my first introduction to AJAX (and JavaScript, for that matter) from Ajax Hacks , which provided a good basis for understanding that this is all and what happens behind the scenes in do-it-for-you libraries, which are all pushing.

0
source

Source: https://habr.com/ru/post/1276863/


All Articles