Ajax Updates |
| Posted: 01 Sep 2009 10:20 AM PDT This is MooTabs! Using a slightly modified CSS file and Fx.Transitions.Back.easeOut as changeTransition ![]()
Demo: http://www.silverscripting.com/mootabs/style2.html Download: http://www.silverscripting.com/mootabs/mootabs1.1.style2.css Source: http://www.silverscripting.com/mootabs/style2.html ![]() Related Listings:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Coolite Studios – Web Control with Ajax Posted: 01 Sep 2009 09:52 AM PDT A huge new feature to be introduced with the next release (v0.7) of the Coolite Toolkit is the [AjaxMethod] Attribute. Converting a standard server-side Method into an “AjaxMethod” enables the Method to be called directly from your client-side JavaScript. No PostBack, no page flicker and all communication is performed through lightweight AJAX + JSON. The [AjaxMethod] Attribute can be applied to any public or public static .NET server-side Method (C#, VB, etc.). An [AjaxMethod] is similar in functionaltiy to the ASP.NET [WebMethod] Attribute except an AjaxMethod is optimized to serialize and return data in an easily consumed JSON response. Getting Started Basic Example The following code sample demonstrates a simple AjaxMethod returning a string to the client.
Calling SayHello returns a total response size of less than 25 characters... that's tight. Success Handling If the server-side AjaxMethod returns an object, we need to provide a way of handling that response. As the last parameter of the JavaScript function you can pass in an optional config object with a success handler. Lets elaborate on our example by adding a
The text argument is pretty simple, as it's the string sent into the server-side SayHello C# Method. The config argument is a JavaScript object literal made up of a collection of name:value pairs. The JavaScript object literal is similar in concept to .NET Anonymous types. It's a "thing" (ie. object) with some properties. In the example above, the success property is set with the name of a JavaScript function to call upon a successful response from the server. Whatever object is returned from the server-side AjaxMethod is serialized into JSON, and passed as the return result into the success JavaScript function. Using our SayHello example, the result is passed to the doAlert JavaScript function. The success function can also be coded inline within the config object.
Summary Adding the [AjaxMethod] Attribute to your server-side Method enables the Method to be called from client-side JavaScript running in a browser, without having to perform a PostBack. The request from the client to the web server is made using Ajax and the response from the server back to the client is packaged as a JSON object. We're just scratching the surface here, so in future posts we'll dive deeper into performance tuning and advanced AjaxMethod configuration options. More information and code samples demonstrating AjaxMethods are available in the recently updated Examples Explorer. The Coolite Toolkit is a suite of powerful Ajax enabled ASP.NET Web Controls which simplify the development of Web Applications. The Coolite Toolkit includes the Ext JS JavaScript Framework and together are dual licensed with an open-source "Community" option or closed-source "Professional" version Demo: http://www.coolite.com/examples/ Download: http://www.coolite.com/download/Coolite.Toolkit.Community.Edition.0.8.1.zip Source: http://www.coolite.com/ ![]() Related Listings:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Posted: 01 Sep 2009 09:02 AM PDT This is the demonstration page for the jTruncate plugin for jQuery. If you are looking for the jTruncate homepage. Plain Jane Example jTruncate is called in the same way that most other jQuery plugins are called. The example below is using the following code, that accepts all the default options.
jTruncate allows you to customize nearly every aspect of the truncation operation. The following options are provided: length: Defaults to 300 The number of characters to display before truncating. minTrail: Defaults to 20 The minimum number of "extra" characters required to truncate. This option allows you to prevent truncation of a section of text that is only a few characters longer than the specified length. moreText: Defaults to "more" The text to use for the "more" link. lessText: Defaults to "less" The text to use for the "less" link. ellipsisText: Defaults to "..." The text to append to the truncated portion. moreAni: Defaults to an empty string The speed argument for the show() method (as specified here). lessAni: Defaults to an empty string The speed argument for the hide() method (as specified here). Custom jTruncate Example The following example demonstrates how to override the defaults described above.
Note that if you override the default animation options, you will notice a "new line" inserted at the point of truncation. This is because the hide/show methods require the animated element to be block level, and thus will begin on its own line. Also note that jTruncate chooses the split location by starting at the length you specify (or the default) and then finds the next space. This is to prevent truncation in the middle of an html tag. This implies that the text needs to have spaces in it (duh), and that any tags within the truncated text cannot contain a space (i.e. = bad). ![]() Related Listings:
|
| You are subscribed to email updates from Ajax Updates To stop receiving these emails, you may unsubscribe now. | Email delivery powered by Google |
| Google Inc., 20 West Kinzie, Chicago IL USA 60610 | |



0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.