Easyjweb + prototype

Source: Internet
Author: User

I haven't written a blog for a long time. Let's talk about it today.

The blog I wrote earlier about the integration of Ajax in easyjweb,

I personally think that this can really simplify the compilation of some Ajax,

On the other hand, I want to talk about another simple method to implement Ajax in some cases (which is common in this case): easyjweb + prototype.

In fact, users who know prototype may already know and use this method. Today we will only introduce this method:

The Ajax. Updater object in prototype can be easily combined with easyjweb to implement some Ajax applications,

Let's use an example to describe how to use Ajax. Updater:

VaR myajax2 = new Ajax. Updater (

'Cardmain ',

Url2,

{

Method: 'get'

}

);

In this way, you can use url2 to request the server segment and fill the returned HTML content in cardmain. Note that the returned content must be HTML, which is suitable for easyjweb.

First, you can obtain an HTML page based on the request. The content of this page needs to be filled with the browser content, for example:

# Foreach ($ card in $! List)

<Div style = "position: absolute; left: $! Randomtool. randomrange (200,500); top: $! Randomtool. randomrange (50,200); background-color: $! Randomtool. randomcolor ('1fee22 '); Height: 250px; width: 200px; Z-index: 0; cursor: Move "onmousedown =" f_mdown (this) "onmousemove =" f_move (this) ">

From: $! Card. fro <br>

Sent to: $! Card. Forwho <br>

Content: $! Card. content <br>

Time: $! Card. inputtime <br>

</Div>

# End

 

Then use

<Div id = "cardmain"> </div>

<Input type = button name = click onclick = "doupdate ();">

You can.

 

This method is most suitable when you only need to change the content of a part of the page.

In addition, the easyjweb application can be quickly transitioned to Web 2.0.

Using this method, it takes only a few minutes to complete an example similar to a phone number query.

You can try it.

(Author:Easyjf open source teamStefYou are welcome to repost it. Please keep the author's statement for reprinting. Thank you !)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.