jQuery未在JSP页面上加载 [英] Jquery not loading on JSP page

查看:81
本文介绍了jQuery未在JSP页面上加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在jsp页面中使用JQuery Mobile做一些事情,但是我的页面在运行它时没有加载jquery,因为当我将其制成html时,同一脚本可以正常工作,我无法确定确切的问题吗?感谢您为该问题提供的解决方案.

I'm doing some stuff using JQuery Mobile in jsp page, but my page not loading jquery when i run it, where as the same script works fine when i make it html,I cannot figure out exact problem? I appreciate any solution for this problems..

这是我在JSP页面中使用的代码.

Here is the code that I'm using in my JSP page..

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1" import="org.apache.struts.action.DynaActionForm, com.sigma.sickkids.global.GlobalConstants"%>
<!DOCTYPE html>
<html>

<head>

<meta name="viewport" content="width=device-width, initial-scale=1; user-scalable=no">
<meta http-equiv="Content-type" content="text/html; charset=utf-8">

<link rel="stylesheet"  href="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.css" /> 
<link rel="stylesheet" href="scripts-css/style.css" />

<link rel="stylesheet" href="scripts-css/master.css" type="text/css" media="screen" title="no title">
<script type="text/javascript" charset="utf-8" src="scripts-css/cordova-1.5.0.js"></script>
<script type="text/javascript" charset="utf-8" src="scripts-css/main.js"></script>

<script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
<script src="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.js"></script>

<script src="scripts-css/custom-form-elements.js" type="text/javascript"></script>
<link rel="stylesheet" href="scripts-css/styleform.css" />

<script src="scripts-css/mobiscroll-1.6.min.js" type="text/javascript"></script>
<link href="scripts-css/mobiscroll-1.6.min.css" rel="stylesheet" type="text/css" />

<script>

  function go(loc){
       window.location.href = loc;
   }



 $('#homepage').load(function(){ 
    $("input[type='checkbox']").attr("checked",false).checkboxradio("refresh");
    var pretype=document.getElementById("editreg");
    var servdate=document.getElementById("servdate");


    var currentTime = new Date()
    var month = currentTime.getMonth() + 1
    var day = currentTime.getDate()
    var year = currentTime.getFullYear()
    servdate.value=$('#regdate').html(); //month + "/" + day + "/" + year;
    $(.abc).hide("fast");

        function goToByScroll(id){
          id = id.replace("link", "");
          $('html,body').animate({scrollTop: $("#"+id).offset().top},'slow');
        }
        $('#verify').change(function(){
           if(this.checked){$('#div1').show("slow");}
                      else {$('#div1').hide("slow");}
           goToByScroll("div1");
         });

        $("#servcode").change(function() {
             if ( $(this).val()=="nodate") {              
                 $('#depend :input').attr('disabled', true);
                 $('#depend :input').val("");
                }
             else {
                 $('#depend :input').attr('disabled', false);
               }
         });




  });

</script>
</head>

推荐答案

我首先想到的是,这种冲突可能会阻止jquery正常运行

My first thought that maybe this kind of clash is preventing jquery from functioning properly

http://docs.jquery.com/Using_jQuery_with_Other_Libraries

这篇关于jQuery未在JSP页面上加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆