<html>
<head>
</head>
<script>
function ForCheckSelected(str)
{
alert(str);
}
</script>
<body class="background">
<input type="button" value="Check Selected" onclick="ForCheckSelected('select * from tableName where a='01'')" >
</body>
</html>
以上是代码重点:'select * from tableName where a='01'' 01是以个有意义的数据,必须以字符串的方式存在。
点击按钮的时候,报JS错误如何解决。。谢谢。
<head>
</head>
<script>
function ForCheckSelected(str)
{
alert(str);
}
</script>
<body class="background">
<input type="button" value="Check Selected" onclick="ForCheckSelected('select * from tableName where a='01'')" >
</body>
</html>
以上是代码重点:'select * from tableName where a='01'' 01是以个有意义的数据,必须以字符串的方式存在。
点击按钮的时候,报JS错误如何解决。。谢谢。
解决方案 »
- 如何通过一个struts2的action返回一个图片并返回在jsp页面上
- 为什么会有*.action这个url?
- dwr InvocationTargetException
- JAVA读取XML文件生成动态树问题
- 在jsp中有onclick="window.print()",其中window.print()是不是自己写的javaScript,还是已经内嵌了,不用自己写了
- 请问哪位大哥大姐有关于heibernate连接msql2000数据库的例子
- 如何仅靠相对路径得知目录下文件是否存在?
- 请问怎样用js实现点击一个按扭使页面实现向前或后退啊!
- 计算距离上次刷新时间
- 不同接口,在同一页面分表存储
- 如何将子窗体中的数据传回父窗体
- 想开发一个火狐、IE都能用的插件
<input type="button" value="Check Selected" onclick="ForCheckSelected('select * from tableName where a=01')" > 把01的单引号去掉
我确定行不通。<html>
<head>
</head>
<script>
function ForCheckSelected(str)
{
alert(str);
}
</script>
<body class="background">
<input type="button" value="Check Selected" onclick="ForCheckSelected('select * from tableName where a=\'01\''))" >
</body>
</html>这是我根据你的说法改的。。你可以复制粘贴到.html文件中,然后用ie打开。如果你行得通,请告知我你ie的版本。。谢谢。
说明一下,这个sql参数是直接从页面tablelist里面拿出来的。问题我已经用替他的方法解决了。但是,就这个单引号的问题,我还是想知道怎么解决。