sending data to same PHP page from Javascript, no

2019-08-17 03:29发布

I have a php page with some functions to recieve POST data, with a page refresh, no AJAX.

Right now I have a form with hidden fields that contain my dynamic data that I send with JS like so: document.my_form.submit();

Is it possible to send the data without using a form?

Basically I want to send an array of URL's from a list with thumbnails, so my function loops over the list and pushes them in arrays.

3条回答
迷人小祖宗
2楼-- · 2019-08-17 03:57

2000 characters should be ok these days:

http://www.boutell.com/newfaq/misc/urllength.html

查看更多
贪生不怕死
3楼-- · 2019-08-17 03:58

you can use get instead of post, but it sounds like the url will get pretty messy. if you aren't opposed to ajax, i would be happy to elaborate on the answer.

查看更多
4楼-- · 2019-08-17 04:01

Nope, you can only POST data via AJAX or a form.

查看更多
登录 后发表回答