Categories

jQuery Desktop

Found an interesting POC of jQuery Desktop using HTML5, CSS and jQuery at SonSpring.com. Though the implementation is basic, its certainly going to trigger more ideas and could be a good way of designing management tools. jQuery is a great library for javascript and when mixed with HTML 5 and CSS can create magic.

Unclosed <P> before <form> breaks form submit in IE when using jQuery

If you are facing issues with form submits using jQuery in IE because of unclosed <P> tags.

Try this:

var form = $(document).find(“form”);

var frm = form.parent().html();

if(frm.toLowerCase().indexOf(‘form’) > -1 && frm.toLowerCase().indexOf(‘/form’) == -1) {
var frmTag = frm.substring(frm.toLowerCase().indexOf(‘<form’), frm.toLowerCase().indexOf(‘>’)+1);
var rest = frm.substring(frm.toLowerCase().indexOf(‘>’)+1);
form.parent().remove();
form.before(frmTag);
form.prepend(rest);
}

jQuery.append() Behaviour

jQuery.append() behaves a differently in different situations. It sometimes moves the contents from the DOM to the new location where it is appended and sometimes it clones it (keeping a copy of the dom element in its original location). I stumbled upon this when trying to fix an issue with <form> submit. The content I [...]