![Phân tích tư tưởng của nhân dân qua đoạn thơ: Những người vợ nhớ chồng… Những cuộc đời đã hóa sông núi ta trong Đất nước của Nguyễn Khoa Điềm](https://timtailieu.net/upload/document/136415/phan-tich-tu-tuong-cua-nhan-dan-qua-doan-tho-039-039-nhung-nguoi-vo-nho-chong-nhung-cuoc-doi-da-hoa-song-nui-ta-039-039-trong-dat-nuoc-cua-nguyen-khoa-136415.jpg)
Apress Introducing dot NET 4 0 with Visual Studio 2010_6
Số trang: 45
Loại file: pdf
Dung lượng: 1.74 MB
Lượt xem: 11
Lượt tải: 0
Xem trước 5 trang đầu tiên của tài liệu này:
Thông tin tài liệu:
Nếu bạn không muốn hiệu quả của việc mã jQuery tay của bạn, bạn có thể sử dụng một công cụ tuyệt vời Glimmer được gọi là sản xuất bởi Microsoft cung cấp một cách tiếp cận dựa trên hướng dẫn
Nội dung trích xuất từ tài liệu:
Apress Introducing dot NET 4 0 with Visual Studio 2010_6 CHAPTER 12 JQUERY Additional Effects In addition to the previous effects, a number of additional effects can be downloaded: fold, pulsate, puff, bounce, and explode (my personal favorite). For more details on these effects please go to http://docs. jquery.com/UI/Effects. Glimmer If you don’t want to hand-code your jQuery effects, you can use a great tool called Glimmer produced by Microsoft that offers a wizard-based approach (see Figure 12-4). Refer to http://visitmix.com/lab/ glimmer. Figure 12-4. Glimmer allows you to easily construct jQuery effects Glimmer allows the construction of simple effects such as rotating images, drop-down menus, and animation. jQuery Tools jQueryPad ( (http://www.paulstovell.com/jquerypad) and http://jsbin.com/ can be very useful tools for prototyping and playing with jQuery.282 CHAPTER 12 JQUERYChaining EventsThe real power of jQuery comes from its capability to chain functions together. Imagine that we wantedto fade our div in and out a number of times. This procedure can be easily accomplished with thefollowing code:$(#div1).fadeOut().fadeIn().fadeOut().fadeIn().fadeOut();Customizing jQueryYou can add your own functions to the jQuery library. For example, to create a simple function that willpop up an alert box, you can do so with the following code://dont use $ alias in case user overrides itjQuery.fn.say = function (message) { alert(jQuery says + message); return this;} You can then call the new function with the following code:$.fn.say(hello).say(good bye); And there is, of course, no reason why you couldn’t write a new effects function and use it as part ofa chain of effects. For more information, please refer to http://docs.jquery.com/Plugins/Authoring.AJAX MethodsIt is very common for performance optimization to need to retrieve data or code from an external sourceafter a page is loaded. jQuery makes this very easy.Load and Run JavaScript FileThe following code loads an external JavaScript file called test.js and then executes it:$.ajax({ type: GET, url: test.js, dataType: script}); The test.js file consists of just the following line:alert(hello); 283 CHAPTER 12 JQUERY Submitting Data You often need to submit data to another web page. This can easily be done with the following code: $.ajax({ type: POST, url: myForm.aspx, data: firstname=Alex&lastname=Mackey, success: function() { alert(form submitted); } }); You will use this functionality in the ASP.NET MVC example (see Chapter 13) to submit your form data: //Submit client side $.ajax({ type: POST, dataType: json, url: Edit, data: { Description: InputDescription, Length: InputLength, DateShowing: InputDateShowing }, success: function(result) { alert(result.Message + adding film at + result.DateShowing); }, error: function(error) { alert(error ); } }); Getting the Latest Version of a Page We can retrieve the contents of a page in the same domain as the calling page with a few lines of code. This could be useful in AJAX scenarios in which you want to load content behind the scenes: $.ajax({ url: default2.aspx, cache: false, success: function(returnHtml) { $(#div1).append(returnHtml); } });284 CHAPTER 12 JQUERYRetrieving a JSON ObjectJSON is a compact format for representing data. jQuery contains support for working with JSON objects.We will first create a page called default2.aspx t hat will return a JSON-formatted string (you will soonlook at a better way of doing this). Right-click your solution and add a new page called default2.aspx and select the place code in 1. a seperate file option. Remove all the code on default2.aspx except for the page declaration. 2. Add the following code to default2.aspx.cs: 3. protected void Page_Load(object sender, EventArgs e) { Response.Buffer = true; Response.Clear(); Response.ContentType = application/json; Response.Write({firstName: Alex,lastName: Mackey}); } Open default.htm ...
Nội dung trích xuất từ tài liệu:
Apress Introducing dot NET 4 0 with Visual Studio 2010_6 CHAPTER 12 JQUERY Additional Effects In addition to the previous effects, a number of additional effects can be downloaded: fold, pulsate, puff, bounce, and explode (my personal favorite). For more details on these effects please go to http://docs. jquery.com/UI/Effects. Glimmer If you don’t want to hand-code your jQuery effects, you can use a great tool called Glimmer produced by Microsoft that offers a wizard-based approach (see Figure 12-4). Refer to http://visitmix.com/lab/ glimmer. Figure 12-4. Glimmer allows you to easily construct jQuery effects Glimmer allows the construction of simple effects such as rotating images, drop-down menus, and animation. jQuery Tools jQueryPad ( (http://www.paulstovell.com/jquerypad) and http://jsbin.com/ can be very useful tools for prototyping and playing with jQuery.282 CHAPTER 12 JQUERYChaining EventsThe real power of jQuery comes from its capability to chain functions together. Imagine that we wantedto fade our div in and out a number of times. This procedure can be easily accomplished with thefollowing code:$(#div1).fadeOut().fadeIn().fadeOut().fadeIn().fadeOut();Customizing jQueryYou can add your own functions to the jQuery library. For example, to create a simple function that willpop up an alert box, you can do so with the following code://dont use $ alias in case user overrides itjQuery.fn.say = function (message) { alert(jQuery says + message); return this;} You can then call the new function with the following code:$.fn.say(hello).say(good bye); And there is, of course, no reason why you couldn’t write a new effects function and use it as part ofa chain of effects. For more information, please refer to http://docs.jquery.com/Plugins/Authoring.AJAX MethodsIt is very common for performance optimization to need to retrieve data or code from an external sourceafter a page is loaded. jQuery makes this very easy.Load and Run JavaScript FileThe following code loads an external JavaScript file called test.js and then executes it:$.ajax({ type: GET, url: test.js, dataType: script}); The test.js file consists of just the following line:alert(hello); 283 CHAPTER 12 JQUERY Submitting Data You often need to submit data to another web page. This can easily be done with the following code: $.ajax({ type: POST, url: myForm.aspx, data: firstname=Alex&lastname=Mackey, success: function() { alert(form submitted); } }); You will use this functionality in the ASP.NET MVC example (see Chapter 13) to submit your form data: //Submit client side $.ajax({ type: POST, dataType: json, url: Edit, data: { Description: InputDescription, Length: InputLength, DateShowing: InputDateShowing }, success: function(result) { alert(result.Message + adding film at + result.DateShowing); }, error: function(error) { alert(error ); } }); Getting the Latest Version of a Page We can retrieve the contents of a page in the same domain as the calling page with a few lines of code. This could be useful in AJAX scenarios in which you want to load content behind the scenes: $.ajax({ url: default2.aspx, cache: false, success: function(returnHtml) { $(#div1).append(returnHtml); } });284 CHAPTER 12 JQUERYRetrieving a JSON ObjectJSON is a compact format for representing data. jQuery contains support for working with JSON objects.We will first create a page called default2.aspx t hat will return a JSON-formatted string (you will soonlook at a better way of doing this). Right-click your solution and add a new page called default2.aspx and select the place code in 1. a seperate file option. Remove all the code on default2.aspx except for the page declaration. 2. Add the following code to default2.aspx.cs: 3. protected void Page_Load(object sender, EventArgs e) { Response.Buffer = true; Response.Clear(); Response.ContentType = application/json; Response.Write({firstName: Alex,lastName: Mackey}); } Open default.htm ...
Tìm kiếm theo từ khóa liên quan:
thủ thuật máy tính tài liệu công nghệ thông tin lập trình máy tính mẹo máy tính cài đặt máy tínhTài liệu liên quan:
-
Top 10 mẹo 'đơn giản nhưng hữu ích' trong nhiếp ảnh
11 trang 332 0 0 -
Làm việc với Read Only Domain Controllers
20 trang 323 0 0 -
Thêm chức năng hữu dụng cho menu chuột phải trên Windows
4 trang 307 0 0 -
70 trang 267 1 0
-
Bài giảng Tin học lớp 11 bài 1: Giới thiệu ngôn ngữ lập trình C#
15 trang 249 0 0 -
Tổng hợp lỗi Win 8 và cách sửa
3 trang 234 0 0 -
Sửa lỗi các chức năng quan trọng của Win với ReEnable 2.0 Portable Edition
5 trang 227 0 0 -
Phần III: Xử lý sự cố Màn hình xanh
3 trang 222 0 0 -
Tổng hợp 30 lỗi thương gặp cho những bạn mới sử dụng máy tính
9 trang 215 0 0 -
Sao lưu dữ liệu Gmail sử dụng chế độ Offline
8 trang 213 0 0