Apache and CORS – Enabling Cross Origin Resource Sharing

Just a few days ago, I was working on an applicaiton which needed to make Cross Origin request to a rails application. This applicaiton was being served by Passenger on Apache server. In front of the application server sits a public facing Apache server where the Load Balancing happens. A custom javascript app deployed at […]

Read more "Apache and CORS – Enabling Cross Origin Resource Sharing"

JQuery: Count elements with similar ids

So I got stuck with the problem of counting the text fields with ids like ‘field1’, ‘field2’, ‘field3’ etc. <input id=’field1′ name=’somename_one’/> <input id=’field2′ name=’somename_two’/> <input id=’field3′ name=’somename_three’/>   I need to get the count of such dynamically generated fields. With JQuery, it can be done simply with the following statement: $(“:input[id^=field]”).length This statement will […]

Read more "JQuery: Count elements with similar ids"

JQuery – Multi Column Table sorting

JQuery + tablesorter plugin is a nice way of implementing multi column table sorting. All you need to do is include two javascripts in your source code. In rails, I did it like this with minified versions of both the jss: <%= javascript_include_tag “jquery-min” %> <%= javascript_include_tag “jquery.tablesorter.min” %> In plain html, that would resolve […]

Read more "JQuery – Multi Column Table sorting"