简体   繁体   中英

Empty GET data with onclick=“$.get()”

I got a script which I use my table sorter script to store the sort order when the page gets refreshed. It used to work perfectly however it's suddenly stopped working and I have no idea. It's creating the session variables however they are empty.

'ClaimSort' => string '' (length=0)
  'ClaimSort2' => string '' (length=0)

The link is working but it would appear that I am not passing the _GET data no longer. Can anyone help...

When clicking on a <th> within the table I initiate the following:

onclick='$.get("ajax/storeSort.php", {ClaimSort:0}, function(data){});'

within storeSort.php I have the following:

if ( $_SESSION["ClaimSort"] == $_GET['ClaimSort'] && $_SESSION["ClaimSort2"] == '0' ) {
    $_SESSION["ClaimSort"] = $_GET['ClaimSort'];
    $_SESSION["ClaimSort2"] = '1';
}elseif ( $_SESSION["ClaimSort"] == $_GET['ClaimSort'] && $_SESSION["ClaimSort2"] == '1' ) {
    $_SESSION["ClaimSort"] = $_GET['ClaimSort'];
    $_SESSION["ClaimSort2"] = '0';
}else{
    $_SESSION["ClaimSort"] = $_GET['ClaimSort'];
    $_SESSION["ClaimSort2"] = '0';
}

代码没有问题,原来有一个php错误阻止它完全执行,我只能从服务器上的Apache日志中选择这个。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM