开发者

Jquery - Drop down form on change event: submit and load() on success

开发者 https://www.devze.com 2023-01-22 13:59 出处:网络
I have a drop down form that submits itself on change without even relying on jquery: <script type=\"text/javascript\">

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.

  1. Are you sure you understand the difference between JavaScript and jQuery? Your first code block is absolutely using jQuery.
  2. 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.
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号