Home >Web Front-end >HTML Tutorial >Ajax does not refresh the acquired data, how can I edit_html/css_WEB-ITnose

Ajax does not refresh the acquired data, how can I edit_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:23:131127browse

How to put the value returned by ajax into the text box and make it editable. . Solve.
For example, the data obtained like this. .
http://bbs.csdn.net/topics/390542453


Reply to discussion (solution)

If there is no file box, create one and put the return value in For example, in the file box:

$('026c666f705047f96ad03dd0b83ad547').attr('value','return value')

If you have it, you can put it directly

$('#id value').val('return value')

If there is no file box, create one and put the return value in the file box. For example:

$('026c666f705047f96ad03dd0b83ad547').attr('value','return value')

If you have it, you can put it directly

$('#id Value').val('return value')

Ask for the specific code. ?

5250af15673c3e7bf09ffd449f9f08fc
For example, the text box looks like this, how to put it. ?

Simply write
Server side

<?phprequire 'global.php';echo $_GET['name']."abc";?>


Client side
<!DOCTYPE html><html>    <head>	<title>this is demo</title>	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">	<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>    </head>    <body>	<div>	    <dl>		<dt>输入数据</dt>		<dd><input type="text" name="inC" /></dd>	    </dl>	    <input type="button" value="发送" id="btn" />	</div>	<div>	    <dl>		<dt>接受数据</dt>		<dd><input type="text" name="onC" /></dd>	    </dl>	    	</div>	<script type="text/javascript">	jQuery(function($){		$('#btn').click(function(){			$.ajax({				url: "/first.php",				type: "GET",				data: 'name='+$('input[name=inC]').val(),				beforeSend: function(){					$('#btn').attr('disabled','true').attr('value','send data');				},				success: function(d){					$('input[name=onC]').val(d);				}			});		});	});	    	</script>    </body></html>

Thanks, I’ll give it a try.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn