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 !)