jQuery的邮政数据邮政、数据、jQuery

2023-09-10 21:46:28 作者:霸佔妳的心▲

我需要使用的链接或图片插入/更新数据。

I need to insert/update data by using link or image

我需要一个code如何使用jQuery调用后的数据!

I need a code how to call post data using jquery !

< A HREF =some.asp的onClick =someaction,送价值>链接

< a href="some.asp" onClick="someaction, value to send" > Link

请帮忙

推荐答案

HTML

<a href="some.asp" class="upload">Link</a>
<input type="hidden" name="parameter" value="value-to-send" />

code

Code

$(function() {
    $('.upload').click( function() {
         $.post( $(this).attr('href'),
                 $(this).next('input[type=hidden]').serialize(),
                 function(data) { do something with returned data } );
         return false;  // cancel link default action
    });
});

您可能还需要检查出的文档在 jQuery.com ,特别是对的如何jQuery的工程

You might also want to check out the documentation at jQuery.com, especially the section on How jQuery Works.