高手帮看看这个JSP哪里有问题?函数和blur都没有进去

问题描述

<%@page contentType="text/html;charset=utf-8"%><%@taglib prefix="s" uri="/struts-tags" %><html ><head><script src="../js/jquery-1.4.3.js"></script><script>$(function(){alert("进了主函数");$("#validatecode").blur(function(){alert("进了blur方法");if(!${user.emailVerifyCode}.equals($("#validatecode").val()){ $("#validatecode").html("<img src='../images/wrong.gif'> 验证码错误");}else{ $("#validatecode").html("<img src='../images/right.gif'> 验证码正确");$("#fshan").attr("onsubmit","return true");}});});</script></head><body><form action="register_ok.jsp" id="fshan" method="post" onsubmit="return false"><div ><div><div>输入您收到邮件中的验证码:<input name="code" type="text" id="validatecode" /><input class="finsh" type="submit" value="完 成" id="Button1" /></div></div></div></form></body></html>函数和blur方法都没有起作用, 两个alert也都没有出来 问题补充:LeeYee 写道

解决方案

换成if($("#validatecode").val() == "<s;property value='user.emailVerifyCode'/>")使用 == 或者 === 进行比较
解决方案二:
引用if(!${user.emailVerifyCode}.equals($("#validatecode").val()){ 这句话报错啊。 ${user.emailVerifyCode}这个是服务器端传的值么,js中不能这样使用,你只能将这个值隐藏在页面或者,如果你用jstl的话要使用 "<c:out value=''/>"这种格式,如果你用的是struts那么应该是用"<s:property value/>在js中获取。如果你直接使用el表达式, javascript 是没有 if({}){}这种语法的

时间: 2024-09-17 04:01:56

高手帮看看这个JSP哪里有问题?函数和blur都没有进去的相关文章

哪位高手帮帮忙? JSP+TOMCAT 报错HTTP Status 500

问题描述 HTTPStatus500---------------------------------------------------------------------------------typeExceptionreportmessagedescriptionTheserverencounteredaninternalerror()thatpreventeditfromfulfillingthisrequest.exceptionjava.lang.NullPointerExcept

我想在html页面中引用freemarker但不知道该怎么配置,求各位高手帮帮忙

问题描述 我想在html页面中引用freemarker但不知道该怎么配置,求各位高手帮帮忙 我想在html页面中引用freemarker但不知道该怎么配置,求各位高手帮帮忙 解决方案 纯html中无法使用.在动态项目中才能使用,如jsp,asp 你要想使用freemarker标签,必须能够被FreemarkerServlet拦截到,然后解析处理成html 所以你直接用ftl页面就行了,为什么要静态网页和动态模版混着用呢 如果真想用..web.xml 中freemarker拦截器(制定拦截*.ht

css百度分享-请高手帮改一个CSS代码 让百度分享和文章链接并排

问题描述 请高手帮改一个CSS代码 让百度分享和文章链接并排 .Article-Tool{ border:1px solid #c3d4e7; position:relative; top:-1px; text-align:right; padding:8px; vertical-align:middle; height:15px; background-color:#f4f8fd} .Article-Tool a{width:16px;height:16px;line-height:16px;

24色位图,字母图片验证码识别,基于MFC对话框的程序,在线求助,高手帮帮忙

问题描述 24色位图,字母图片验证码识别,基于MFC对话框的程序,在线求助,高手帮帮忙 24色位图(如下图)字母图片验证码识别,基于MFC对话框的程序,在线求助,高手帮帮忙

php字符串转换-php 字符串转换为题,求高手帮看看那里有问题?

问题描述 php 字符串转换为题,求高手帮看看那里有问题? Date.prototype.format = function(format){ var o = { "M+" : this.getMonth()+1, //month "d+" : this.getDate(), //day "h+" : this.getHours(), //hour "m+" : this.getMinutes(), //minute &quo

sql server-SQL Server提示错误,求高手帮解决

问题描述 SQL Server提示错误,求高手帮解决 select gl.ccus_id 客户编码, gl.cexch_name 币种, gl.cbegind_c 金额期初方向, (case when gl.cbegind_c = '借' then SUM(ISNULL(gl.mb, 0)) + SUM(ISNULL(ap.iAmount_f,0)) - SUM(ISNULL(dts.iQuantity * dts.iTaxUnitPrice, 0)) else sum(isnull(-gl.m

path-c++代码,请高手帮我看一下这个代码怎么修改

问题描述 c++代码,请高手帮我看一下这个代码怎么修改 return 0; } TCHAR szPath[MAX_PATH] = { 0 }; HRESULT hr; hr = SHGetFolderPath(NULL, CSIDL_PERSONAL, NULL, SHGFP_TYPE_CURRENT, szPath); if(SUCCEEDED(hr)) { CString strPath = szPath; strPath += _T("\temp"); hr = ::URLDow

load-VB提示编译错误,属性使用无效,高手帮我看看啊

问题描述 VB提示编译错误,属性使用无效,高手帮我看看啊 Private Sub cmdcancle_click() unload Me End Sub Private Sub frmaddpoem_load() cleartextbox initTC initlb End Sub Sub cleartextbox() Dim i As Integer For i = 0 To 3 txtpoem(i).Text = "" Next i End Sub 解决方案 initTC init

python文件语句解析-请高手帮我解释下这些语句的意思,跪谢!

问题描述 请高手帮我解释下这些语句的意思,跪谢! import osimport ref_cg=open('dm_cg.txt''w')f_sb=open('dm_sb.txt''w')dir_list=[]for file in os.listdir(): if os.path.splitext(file)[1] == '.txt': dir_list.append(file)dir_list.remove('dm_cg.txt')dir_list.remove('dm_sb.txt')#数据