weixin_33681778 2014-08-14 21:05 采纳率: 0%
浏览 30

从jQuery访问PHP值

It's strange that I didn't find anything at Google but I hope you can help me. I have a Table with different accounts. When I click on one of those rows, another table for this specific account will slide in. This "specific table" for this account needs to show some account specified data and therefore I need to tell my ajax request for what account he needs those data. The problem: I don't know how I can tell this. I never used Ajax requests without a form.

My HTML Table (I need the var $orderid for my ajax request)

foreach($data as $row)
{
    $orderid =$row['id'];
    $username = $row['name'];
    $done = $row['refsDone'];
    $quantity = $row['quantity'];
    $running =$row['refsRunning'];
    $untouched = $quantity - ($done+$running);
    echo "
        <tr class='header mySlideToggler'>
        <td class='align-center'>$username</td>
        <td>0 %</td>
        <td>22 Aug 2014</td>
        <td>$done / $quantity</td>
        <td>$running</td>
        <td>$untouched</td>
        <td>
            <a href='#' class='table-icon edit' title='Edit'></a>
            <a href='#' class='table-icon expand mySlideToggler' title='Expand'></a>
            <a href='#' class='table-icon delete' title='Delete'></a>
        </td>
        </tr><tr style='padding: 0'><td colspan='7' style='padding: 0'>
            <div class='slideMe' style='display: none'>
                Content of the additional info is here
            </div>
        </td></tr>";
}

My Jquery part which handles only the slide effect of the div and its trigger function:

$('.mySlideToggler').click(function( event ){
    event.preventDefault();
    event.stopPropagation();
    $(this).closest('tr').next().find('.slideMe').slideToggle();
});

So basically my question is: How can I access the php value $orderid from my Jquery function?

  • 写回答

4条回答

      报告相同问题?

      相关推荐 更多相似问题

      悬赏问题

      • ¥15 c++字符串分割问题
      • ¥15 关于#sql#的问题:没有用命令关闭cdc,手动把系统表开启的cdc右键删除了
      • ¥15 android freedom
      • ¥15 使用自定义的类型代替内置类型可行吗
      • ¥15 关于STM32的SPI和ENDAT接口编码器通信的问题
      • ¥15 关于#pdfbox#生成的PDF文件正常,转图片中文乱码的问题,如何解决?
      • ¥15 ADS中有关DAC控件的使用问题
      • ¥15 win11如何运行geoserver
      • ¥15 审稿意见请教-用ERNIE进行小样本分类的对比实验问题
      • ¥15 gem5搭建arm v8