bijinping_1989 2015-12-07 03:29 采纳率: 0%
浏览 1831

javascrip 全局变量 使用时undefined

 <%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<title>test</title>
<%
    String bnoname = request.getParameter("bnoname");
    String start = request.getParameter("start");
    String end = request.getParameter("end");
%>
<script type="text/javascript">
    var chart, option, charts, options;
    var oldname = "";
    var bnoname = "<%=bnoname%>";
    var start = "<%=start%>";
    var end = "<%=end%>";

    $(document).ready(function() {
        selectBno();
        updatedatas();
    });

    function updatedatas() {
        alert(bnoname);
    }

    function selectBno() {
        oldname = "value1";
        if(bnoname == "null"){
        bnoname = oldname;
        }

    }

    $(function() {
        $('#bookview').edatagrid({});
    });

    function initpolygon1detail(polygon) {
        charts = echarts.init(document.getElementById(polygon));
    }

</script>

</head>

<body style="visibility: visible;" >
<div id="polygondetail1"
        style="height:400px;width:95%; margin-top:30px; margin-left:20px;"></div>

    <div style="width: 95%; margin-left:20px;">
        <table id="bookview" title="历史记录" rownumbers="true" pagination="true"
            fitColumns="true" singleSelect="true" pageSize=10 width=100%/>
    </div>
    </body>

</html>

在updatedatas函数中弹出的对话框中,不是已经赋值的

  • 写回答

4条回答

  • bdmh 移动开发领域优质创作者 2015-12-07 03:30
    关注

    就是没有取得值,你看看参数是不是没有传递过来

    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog