Copy codeThe Code is as follows:
$ (Function (){
Ajaxload ("? Uid = 1 <% = Yan. GET_Dict (id, 8, TableName) %> ")
$ ("# ThreeM a: first"). addClass ("addBg ");
$ (". PageP2 "). live ("click", function () {var NewUrl = $ (this ). attr ("href"); if (jQuery. browser. msie) {var IE = $. browser. version; if (IE = "7.0" | IE = "6.0") {NewUrl = "? "+ NewUrl. split ('? ') [1] }}; Ajaxload (NewUrl); return false ;});/* return false to prevent the default a tag jump, use ajax Request */
$ ("# ThreeM a"). click (function (){
If (! $ (This ). hasClass ("addBg") {$ ("# ThreeM "). removeClass ("addBg"); $ (this ). addClass ("addBg ")}
Var Url = "? Uid = 1 "+ $ (this). attr (" id ");
Ajaxload (Url );
})
})
Function Ajaxload (parm)
{
$. Ajax ({
Type: "GET ",
Url: "/stus/3th. aspx" + parm,
Cache: false,
BeforeSend: function () {$ ("# Three" inline .html ("<div> load... </div> ")},
Success: function (msg ){
$ ("# Three" cmd.html (msg );
},
Error: function () {$ ("# Three" example .html ("Load failure ...")}
});
}
The jQuery. browser method has the following parameters and returns true or false:
Safari
Opera
Msie
Mozilla
It is determined by referencing the browser here, because the href = "? Uid = "the whole address is obtained. I don't know why. Use split to intercept...
The $. live () method is a newly added function in 1.3.2, which supports custom events in 1.4.1. Check the api for details...
In addition, bubble of the live method:
The dynamically generated a tag obtained by the ajax commit is bound to the click event using the Live () method. The second query will execute two click events and bubble up. If you use the one () method, one click will become invalid.
Finally, bind () is used to Unbind cilick. You can.