Jquery not loading on JSP page

僤鯓⒐⒋嵵緔 提交于 2020-01-07 05:38:29

问题


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..

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>

回答1:


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

http://docs.jquery.com/Using_jQuery_with_Other_Libraries



来源:https://stackoverflow.com/questions/10241789/jquery-not-loading-on-jsp-page

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!