Jquery - Drop down form on change event: submit and load() on success
I have a drop down form that submits itself on change without even relying on jquery:
<script type="text/javascript">
$("#sortForm").change(function(){
this.submit();
});
</script>
But on a certain page (not everywhere) I need it to also load an external page on success, like this:
$('#tread').load('external_page.php #tread').slideDown('slow');
How do I do it? Just in case - I have jquery form plugin.
The slideDown() function here is my second question actually - I have seve开发者_运维知识库ral instanses on my site where I'd like to animate the loading,but nowhere it works. Can animations work with .load() at all? Thanks!
A couple things.
- Are you sure you understand the difference between JavaScript and jQuery? Your first code block is absolutely using jQuery.
- Animations can work with .load(), but you need to use a 2nd parameter so that it is called on completion. There's more info on the api page.
精彩评论