【急切】汉字字符串作为javascript函数的参数,为什么没有反应呢?(与php的混合应用) 我这些需要处理一个javascript响应函数,它的参数是通过<?echo "好吗"; ?>传递进来的。可是为什么我的函数没有反应呢,我这里是用alert来处理的;但是我要是改成其他字符比如<?echo "aa11"; ?>它就能正常显示。这是怎么回事呀?好急呀!网上查了一天了也没有答案。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 这是我的测试代码:<?php//此函数主要是对与数据库中的语句预定义自负添加反斜杠,get_magic_quotes_gpc用来检测是否添加了反斜杠,addslashes用来添加反斜杠 function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue; switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; } return $theValue; }?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>无标题文档</title><style type="text/css"><!--.style15 {font-size: 14px; font-weight: bold; }--></style></head><body><table width="1379" height="117" border="1" id="table1"> <form name="form1" method="post" action="textarea1.php" enctype="multipart/form-data"> <tr> <td id="ttt1">heheheheheheh</td> <td><a onClick="javascript:func(a=<? echo "22"; ?>)">选择</td> <td id="t"> </td> <td> </td> <td> </td> <td> </td> <td> <input type="submit" name="submit" value="提交"> <input type="button" name="delete" value="删除"> </td> </tr> <input type="hidden" name="MM_insert" value="form1"> </form></table></body><script type="text/javascript" language="javascript">function func(a){ alert(a);}</script></html>你说的是这个意思吗? <a onClick="func('<? echo "好吗"; ?>');"> 请教jQuery的表格插件flexigrid的使用问题 请教一个jQuery点击顺序的问题! 如何制作滑动焦点广告图片? javascript new的使用 关于下拉框选择后触发的事件~~~ 在页面中如何画出一个层,左上解绝对在鼠标坐标点上 如何更换图片??谢谢, IE6.0中通过js脚本改变下拉框选中项的问题 asp中能不能将记录集结果赋给数组,并将数组作为参数调用javascript函数??? 请问我该如何用javascript变量给一个表格的高度赋值? http后面的冒号双斜杠 有什么做用 帮忙解决个问题...javascript + Jquery
//此函数主要是对与数据库中的语句预定义自负添加反斜杠,get_magic_quotes_gpc用来检测是否添加了反斜杠,addslashes用来添加反斜杠
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue; switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
}
return $theValue;
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<style type="text/css">
<!--
.style15 {font-size: 14px; font-weight: bold; }
-->
</style>
</head><body>
<table width="1379" height="117" border="1" id="table1">
<form name="form1" method="post" action="textarea1.php" enctype="multipart/form-data">
<tr>
<td id="ttt1">heheheheheheh</td>
<td><a onClick="javascript:func(a=<? echo "22"; ?>)">选择</td>
<td id="t"> </td>
<td> </td>
<td> </td>
<td> </td>
<td>
<input type="submit" name="submit" value="提交">
<input type="button" name="delete" value="删除">
</td>
</tr>
<input type="hidden" name="MM_insert" value="form1">
</form>
</table>
</body>
<script type="text/javascript" language="javascript">
function func(a)
{
alert(a);
}
</script>
</html>你说的是这个意思吗?