问题描述
我有一个列表项是Executive Room,当我点击该列表时,我用参数tabExe调用myFunction('tabExe')方法,在我的控制台中,它打印值tabExe,是吗成功填充变量?我在列表项下面有一个textarea,如何使用php打印textarea中的值?请帮忙... tnx
// HTML
I have a list item which is Executive Room, when i click that list, I call the myFunction('tabExe') method with a parameter "tabExe", In my console, it prints the value "tabExe", does it populate the variable successfully ? and I have a textarea below the list item, how to print the value in the textarea using php? please help... tnx
//HTML
<ul><li><a name="tabExe" önclick="myFunction('tabExe');" id="tabExe" href="#Exec">Executive Room</a></li></ul>
// JavaScript
//JavaScript
function myFunction(str){
var val = str;
alert(val);
$.ajax({
type: 'POST',
url: 'ROOMS.php',
data: {
source1 : val,
},
success: function( data ) {
console.log( data );
}
});
}
删除了SHOUTING,添加了代码块 - OriginalGriff [/ edit]
[edit]SHOUTING removed, Code blocks added - OriginalGriff[/edit]
推荐答案
删除了SHOUTING,添加了代码块 - OriginalGriff [/ edit]
[edit]SHOUTING removed, Code blocks added - OriginalGriff[/edit]
<html>
<head>
<script type="text/javascript" src="jquery/jquery-1.3.2.min.js"></script>
<script type="text/javascript">
function myFunction(str){
var val = str;
alert(val);
这篇关于如何使用PHP打印值。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!