Variable not added a question mark?

0 like 0 dislike
30 views
There is such code
$(".service_delete").click(function(){ let id_hash = $(this).data('dataname'); // read data into a variable var hd = $(this); var hd2 = "."+id_hash; console.log(id_hash); $.ajax({ url: "/php/service_delete.php", type: "POST", data: {"id_hash": id_hash}, success: function(){ hd.hide(); $(hd2).hide(); } }) })


when you have deleted the item.

When id_hash write the string without the ?/$ such signs that clearly works, but when I add such marks gives an error.

Help please, what to do?
asked by | 30 views

1 Answer

0 like 0 dislike
Each parameter to encode that special characters are correctly perceived by the server
\rhttps://developer.mozilla.org/ru/docs/Web/JavaScri...

p.s. didn't notice the comments. The error above ajax request is obtained, because the point is wrapped in double quotes, try single quotes.
answered by

Related questions

0 like 0 dislike
0 answers
0 like 0 dislike
2 answers
0 like 0 dislike
1 answer
0 like 0 dislike
2 answers
0 like 0 dislike
2 answers
24,509 questions
45,932 answers
0 comments
345 users