AJAX ResponseText调用 [英] AJAX ResponseText call

查看:85
本文介绍了AJAX ResponseText调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请帮助我解决所有问题.ResponseText对象包含以下文本,例如1 Nestle Dairy 10;其中1是ProductID字段,Nestle是Product字段,Dairy是Category字段,而10是字段中的数量.我必须在四个输入框中表示它们.我想像文档一样显示它们.getElementByID("txtProdID").value = ResponseText.仅带文本的内容,当空间到达时,它会到达另一个空间输入.感谢和问候.上帝保佑大家.

Kindly help me with this matter.Everything has been done.The ResponseText object contains the following text for example 1 Nestle Dairy 10;where 1 is the ProductID field, Nestle is the Product field,Dairy is the Category field and 10 is the quantity in hand field.I have to represent them in four input boxes.I want to show them like that document.getElementByID("txtProdID").value=ResponseText.Something which brings only texts and when space comes it reaches towards the other input.Thanks and regards.God bless you all

推荐答案

在JavaScript中为字符串定义了split()方法.您可以拆分响应,然后使用数组填充文本框.

看这里:
MSDN:拆分方法(JavaScript) [ ^ ]
JavaScript split()方法 [
There is a split() method defined for strings in JavaScript. You can split the response and then use the array to fill textboxes.

Look here:
MSDN: split Method (JavaScript)[^]
JavaScript split() Method[^]

Sample:
fullProduct = ResponseText;
var splitProduct = fullProduct.split(' ');



试试吧!



Try!


这篇关于AJAX ResponseText调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆