Heim  >  Artikel  >  Backend-Entwicklung  >  javascript-ajax 获取表单内容然后传递PHP

javascript-ajax 获取表单内容然后传递PHP

WBOY
WBOYOriginal
2016-06-02 11:28:121022Durchsuche

ajaxjavascript表单php

我之前一直在用DOM通过js提取表单内容给PHP做处理,其实也就相当于没用form。。

后来form的内容越来越多了,通过一个个getElementById来获取表单内容然后给PHP越来越不现实了

我在想能不能通过form原本的POST方式(或者有别的方式?)直接将表单内容变成数组,然后js获取数组之后在传递给后台PHP,然后PHP在解析数组做处理,这样做ajax?

可能以上描述不是很专业,忘大神谅解,非常感谢

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn