Conversation
Compatibility with jQuery 1.9
|
Looks simple enough - is this all that's required? Does it maintain backwards compatibility? |
|
Yes! I've tried it also with jQuery 1.8.3 and it worked well. |
|
Thanks- tested on my live demo (http://brianzeligson.com/djax) and it breaks (no $.parseHTML available in jQuery 1.4.4) I realize that's a pretty old version, but the fix for me was as simple as This has the advantage of using $.parseHTML when it's available, and falling back on the old method when it's not, and should keep things working in all versions. If you'd like to make this adjustment I'll be happy to merge the pull. |
|
Sounds good. Thanks for that! |
|
Likely because djax is bound to links, as opposed to this context being a form submit. The easiest solution is probably to update a hidden link based on the form input and trigger a click instead of allowing default form submission, something like this: Keep me posted on your pull request and I'll merge once it's adjusted. |
|
For those wondering how to do search, here's how I got it working all nice and pretty inside djax. HTML: JQUERY: $('#searchform').submit(function(e){
event.preventDefault();
$('#search-submit').attr('href', '<?php bloginfo('url');?>/?s='+encodeURIComponent($('#search').val())).trigger('click');
}); |
Compatibility with jQuery 1.9