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

WBOY
Release: 2016-06-24 12:23:13
Original
1099 people have browsed it

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:

$('').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:

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

If you have it, you can put it directly

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

Ask for the specific code. ?


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

Simply write
Server side

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


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>
Copy after login

Thanks, I’ll give it a try.

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template