Passing value with a minus symbol does not seem to work ...

Passing value with a minus symbol does not seem to work ...

redsunsetredsunset Posts: 44Questions: 15Answers: 0

I have the following code that is failing, I guess due to the minus symbol in that string that is added:

var sid = '63bacc32-d6ba-420c-9b49-299c08e5fb39';

var table23 = $('#table23').DataTable({
    "ajax": "data-singlecard.php?job=getsinglecard&sid="+sid+"&useridbuyer="+useridbuyer+"&userCurrencyBuyer="+userCurrencyBuyer,

but sid is not passed at all ... I can not catch it with $_GET in php.

what can I do to make it work?

Answers

  • kthorngrenkthorngren Posts: 21,336Questions: 26Answers: 4,951

    Don't see anything that stands out as a problem. Are you able to get the other values?

    I would try using the ajax.data option to build your parameters. It may or may not help but it would make for more readable code. For example:

        "ajax": {
          "url": "data-singlecard.php",
          "data": {
            "job": "getsinglecard",
            "sid": sid,
            "useridbuyer": useridbuyer,
            "userCurrencyBuyer": userCurrencyBuyer
          }
        }
    

    Kevin

  • redsunsetredsunset Posts: 44Questions: 15Answers: 0

    thank you very much! I will give it a try!

This discussion has been closed.