Geeks With Blogs
Łukasz Kuryło's blog May 2011 Entries
[jQuery] Determine which mouse button was pressed
This is very easy to check, which mouse button was pressed using jQuery. This solution works propertly on IE (tested on 9), Firefox (tested on 4), Chrome. In Opera there doesn't work the middle button and the browser context menu is showing. $('#someElement').mousedown... { switch (e.which) { case 1: alert('Left mouse button pressed'); break; case 2: alert('Middle mouse button pressed'); break; case 3: alert('Right mouse button pressed'); break; default: alert('Unsupported mouse button'); ......

Posted On Thursday, May 26, 2011 7:15 PM

Lost spaces in latex begin{displaymath}
In the Latex begin{displaymath} all spaces are ignored, e.g. this code \begin{displaymath} Y=\{ B_i \subseteq Z : i \in X \}, where X \subseteq \mathbb{N} \end{displaymath} will look after compile: ...,whereX... To avoid this situation there is a list of commands to deal with this: \, (thinspace) \; (thickspace) \quad (quadspace) \qquad (double quadspace) \! (negative thinspace) More info can be found here ......

Posted On Saturday, May 14, 2011 9:42 PM

Sending json to xml web service as a parameter.
I have lost recently some time to send a json parameter to my web service using jquery. Suppose that we have the data in an javascript array: var attributes=[]; $('#PreviewGroup1_DecisionA... input:checkbox').each(funct... attributes.push({attribute: elem.value, checked: elem.checked}); }); To send that array to web service we simply need to do $.ajax({ url: '../Services/PreviewFormWeb... dataType: "json", data: "attrs="+ JSON.stringify(attributes), ......

Posted On Monday, May 2, 2011 7:38 PM

Copyright © Łukasz Kuryło | Powered by: GeeksWithBlogs.net