J
J
jemanov2016-07-09 12:36:58
JavaScript
jemanov, 2016-07-09 12:36:58

How to pass parameters from letters to the server in getJSON?

$.getJSON("control.php", {act:1, word:word}, ​​function(data)
{
......
});

Strictly speaking, if word - consists of numbers, then everything is normally transmitted.
If word contains English or Russian letters, then nothing is transmitted.
How to be?

PS $.ajax({url: 'control.php', type: 'POST', dataType: 'json',.... doesn't work either.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Skogorev, 2016-07-09
@EnterSandman

act:1, word:'word'

M
Maxim Alekhin, 2016-07-09
@Settler1

The code is correct, the result is:
control.php?act=1&word=test
check the word variable, it may not exist
or pass word like this: 'word'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question