Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/80.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
jquery+;php发送值_Php_Jquery - Fatal编程技术网

jquery+;php发送值

jquery+;php发送值,php,jquery,Php,Jquery,我创建的表单需要一个值,因为该表单编辑不同的用户。 那么如何从jquery发送该值呢?我知道如何使用combobox,但我想通过链接: 比如-name[details],当有人点击details时,表单会弹出,所以我想模仿index.php?id=2,但是使用jquery,有什么想法吗 是否要通过JQuery和链接显示某些内容?修改选择器以指向正确的DOM对象,例如带有类“details”的锚标记 如果要加载链接指向的内容,请使用(未测试) $('a.details')。单击(函数() {$.g

我创建的表单需要一个值,因为该表单编辑不同的用户。 那么如何从jquery发送该值呢?我知道如何使用combobox,但我想通过链接:


比如-name[details],当有人点击details时,表单会弹出,所以我想模仿index.php?id=2,但是使用jquery,有什么想法吗

是否要通过JQuery和链接显示某些内容?修改选择器以指向正确的DOM对象,例如带有类“details”的锚标记

如果要加载链接指向的内容,请使用(未测试)

$('a.details')。单击(函数()

{$.get('index.php?id=2',如果id存储在li元素中,则可以使用以下方法获取“id”属性:

$('li').attr('id');

你能试着更好地解释一下吗。即使在阅读了两次问题之后,也很难理解你是什么。当然,你知道当你在php中有一个发送值的链接,并且你用$\u get获得它时,我想这样做,但是通过jquery使用动态创建的文本链接。但是我不知道怎么做。
$('a .details').click(function ()
{
  var anchor = this;
  $.get(
    $(anchor).attr('href'),
    function(html)
    {
      $('#results').html(html);
    });
});
$('a .details').click(function ()

{  $.get(    'index.php?id=2', <--------------I need to pass that id=2 from a link thats created dynamicaly.    

function(html)   

 {      $('#results').html(html);    });});
<ul id="cat" >
</ul>
$('li').attr('id');