且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在JSP中使用JQuery SWF插件

更新时间:2023-01-16 17:10:18

您的HTML 语法上无效 .浏览器的行为无法预测.

Your HTML is syntactically invalid. The browser behaviour is unpredictable.

这个在语法上是有效的.试试看.

This one is syntactically valid. Give it a try.

<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<!DOCTYPE html>
<html>
    <head>
        <title>Insert your title</title>
        <script type="text/javascript" src="js/jquery-1.4.2.js"></script>
        <script type="text/javascript" src="js/jquery.swfobject.1-1-1.js"></script>
        <script type="text/javascript">
            var bar_chart = $.flash.create ({
                swf: 'flash/open-flash-chart.swf',
                width: 350,
                height: 260,
                wmode: 'transparent',
                play: true,
                flashvars: {
                    "get-data": "getChart1Data"
                }
            });

            function getChart1Data() {
                return JSON.stringify(${chart1Data});
            }

            function ofc_ready() { 
                /**/ 
            }

            $(document).ready(function() {
                $('#bar_chart').html(bar_chart);
            });
        </script>
    </head>
    <body>
        <div id="bar_chart"></div>
    </body>
</html>

PS:我删除了表格,因为它不完整,只会给演示增加噪音.

PS: I removed the table since it's incomplete and only adds noise to the demo.