Ajax首先还是之后? [关闭]

Closed. This question is opinion-based. It is not currently accepting answers.
                </div>
            </div>
        </div>
                <hr class="my12 outline-none baw0 bb bc-powder-2">
            <div class="grid fw-nowrap fc-black-600">
                    <div class="grid--cell mr8">
                        <svg aria-hidden="true" class="svg-icon iconLightbulb" width="18" height="18" viewbox="0 0 18 18"><path d="M9.5.5a.5.5 0 0 0-1 0v.25a.5.5 0 0 0 1 0V.5zm5.6 2.1a.5.5 0 0 0-.7-.7l-.25.25a.5.5 0 0 0 .7.7l.25-.25zM1 7.5c0-.28.22-.5.5-.5H2a.5.5 0 0 1 0 1h-.5a.5.5 0 0 1-.5-.5zm14.5 0c0-.28.22-.5.5-.5h.5a.5.5 0 0 1 0 1H16a.5.5 0 0 1-.5-.5zM2.9 1.9c.2-.2.5-.2.7 0l.25.25a.5.5 0 1 1-.7.7L2.9 2.6a.5.5 0 0 1 0-.7z" fill-opacity=".4"></path><path opacity=".4" d="M7 16h4v1a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1v-1z" fill="#3F3F3F"></path><path d="M15 8a6 6 0 0 1-3.5 5.46V14a1 1 0 0 1-1 1h-3a1 1 0 0 1-1-1v-.54A6 6 0 1 1 15 8zm-4.15-3.85a.5.5 0 0 0-.7.7l2 2a.5.5 0 0 0 .7-.7l-2-2z" fill="#FFC166"></path></svg>
                    </div>
                <div class="grid--cell lh-md">
                    <p class="mb0">
                        <b>Want to improve this question?</b> Update the question so it can be answered with facts and citations by <a href="/posts/21732486/edit">editing this post</a>.
                    </p>
                    <p class="mb0 mt6">Closed <span title="2014-02-13 06:07:13Z" class="relativetime">6 years ago</span>.</p>
                </div>
            </div>
    </aside>

I'm working on a web application alone using laravel, i'm the developer and the designer, i do not want to invest lots of time on the front end at this time, i want to make sure that the kitchen is doing it's job well, later on ill invest some time on improving the design, ux improvements and following the snowball approach.

I know for sure that i will need to Ajaxify many forms in the application, however until now i have been following the "Learn and implement" approach, and i have never used ajax before, the question is, so i'm trying to decide whether i should start learning ajax now or can i stall it until i'm done with the backend? and the decision relies on another question... does it require lots of time/changes to ajaxify an application?

Because if it's a matter of routing only, then i can add it later on.

  • I'm completely aware that this can be categorized as an opinion based / not constructive question, but if you share your experience with me then it can really help me with making the decision. thanks
</div>

I understand your need not to waste too much time with front end. That's why I am using Twitter Bootstrap :)

Learning how Ajax works is very mind-opening experience. It is not just about one small technology in the sea of web technologies. It is not just about front end. It is about web revolution, google, mashups,web 2.0, great usage of HTTP protocol, stateless nature of internet, SPA-s, browsers,Javascript power... You will become much, much better web-developer if you learn Ajax. And when you learn to think from both ends - front and back you'll better understand how web works. So, take your time and find a good tutorial on Ajax - you wont regret. And please don't make differentiation between back and front ends. It is all part of the same process. Besides it is fun.

UPDATE:

Laravel ships with builtin ajax support.Just do

Request::ajax()

and you will know if request is XMLHttpRequest (Ajax)

You should really decide now whether your application will support a traditional postback model, an ajax model or both (this is quite rare today).

The reason is that communication with the server and dealing with the responses you get back are quite different.

With the traditional forms post, the browser takes care of packaging up your form data, sending it to the server, waiting for the server's response and dealing with response code (ie redirect, error, etc) and typically resulting in an entire page redraw.

This is quite different from using Ajax because you'll be writing code to package up your form data, make the ajax call, handle the response from your server and update the DOM.

There are many other differences between these two general types of applications (and many application mix both models) including security concerns (cross site request forgery is a concern for the traditional model but not for the Ajax model).

I suggest you choose how you want your application to operate now and if it indeed is to use Ajax, to write your application correctly from the start.