单击" jquery.min.js"中的事件工作。但不能使用" jquery.mobile.min.js"

时间:2017-01-25 18:42:18

标签: jquery mobile click

如果我修改了jquery文件" jquery.min.js"到" jquery.mobile.min.js" Click事件不起作用。 在其他页面上,我将需要使用这两个版本。

JQUERY:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
    <script>
        $(document).ready(function(){
            var tag = "";

            $("button#upload").click(function() {
              $("#upload_file").click();
            });

            $("#upload_file").on('change', function() {
              tag = "file";
              var filename = $('input[type=file]').val().split('\\').pop();
              $('#EmployeeId').val(filename);
            });

            $("#EmployeeId").on('change', function() {
              tag = "text";
            });

            $("#tag").on('click', function() {
              alert(tag);
            });
        }); 
    </script>

BODY:

    <input type="text" id="EmployeeId" value="" />
    <input type="file" id="upload_file" style="display:none" />
    <button id="upload">UpLoader PRO</button>
    <p>&nbsp;</p>
    <button id="tag">TAG view</button>

1 个答案:

答案 0 :(得分:0)

我已经找到了解决方案:

<?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="template_Table" pageWidth="842" pageHeight="595" orientation="Landscape" whenNoDataType="NoPages" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20">
    <property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/>
    <subDataset name="Dataset1">
        <queryString>
            <![CDATA[]]>
        </queryString>
    </subDataset>
    <field name="campaignName" class="java.lang.String"/>
    <field name="numTransmissions" class="java.lang.Integer"/>
    <group name="Group1">
        <groupExpression><![CDATA[(int)($V{REPORT_COUNT}/15)]]></groupExpression>
    </group>
    <group name="Group2">
        <groupExpression><![CDATA[(int)($V{REPORT_COUNT}/5)]]></groupExpression>
    </group>
    <detail>
        <band height="449" splitType="Stretch">
            <componentElement>
                <reportElement stretchType="RelativeToTallestObject" mode="Transparent" x="0" y="0" width="800" height="199" forecolor="#FFFFFF" backcolor="#424242">
                </reportElement>
                <jr:table xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd">
                    <datasetRun subDataset="Dataset1"/>
                    <jr:column width="52">
                        <jr:tableHeader height="70">
                            <staticText>
                                <reportElement x="0" y="0" width="52" height="70"/>
                                <box leftPadding="3"/>
                                <textElement textAlignment="Left" verticalAlignment="Middle" markup="html">
                                    <font fontName="Verdana" size="9"/>
                                </textElement>
                                <text><![CDATA[Campaign Name]]></text>
                            </staticText>
                        </jr:tableHeader>
                        <jr:detailCell height="50">
                            <textField>
                                <reportElement x="0" y="0" width="52" height="50"/>
                                <box leftPadding="6"/>
                                <textElement textAlignment="Left" verticalAlignment="Middle">
                                    <font fontName="Verdana"/>
                                </textElement>
                                <textFieldExpression><![CDATA[$F{campaignName}]]></textFieldExpression>
                            </textField>
                        </jr:detailCell>
                    </jr:column>
                    <jr:column width="53">
                        <jr:tableHeader height="70">
                            <staticText>
                                <reportElement x="0" y="0" width="53" height="70"/>
                                <box leftPadding="3"/>
                                <textElement textAlignment="Left" verticalAlignment="Middle" markup="html">
                                    <font fontName="Verdana" size="9"/>
                                </textElement>
                                <text><![CDATA[Email Transmissions]]></text>
                            </staticText>
                        </jr:tableHeader>
                        <jr:detailCell height="50">
                            <textField>
                                <reportElement x="0" y="0" width="53" height="50"/>
                                <textElement textAlignment="Center" verticalAlignment="Middle"/>
                                <textFieldExpression><![CDATA[$F{numTransmissions}]]></textFieldExpression>
                            </textField>
                        </jr:detailCell>
                    </jr:column>
                </jr:table>
            </componentElement>
        </band>
    </detail>
    <summary>
        <band height="400" splitType="Stretch">
            <pieChart>
                <chart evaluationTime="Report">
                    <reportElement x="135" y="0" width="270" height="300"/>
                    <chartTitle>
                        <titleExpression><![CDATA["My First JR Pie Chart"]]></titleExpression>
                    </chartTitle>
                    <chartSubtitle/>
                    <chartLegend/>
                </chart>
                <pieDataset>
                    <keyExpression><![CDATA[$F{campaignName}]]></keyExpression>
                    <valueExpression><![CDATA[$F{numTransmissions}]]></valueExpression>
                </pieDataset>
                <piePlot>
                    <plot/>
                    <itemLabel/>
                </piePlot>
            </pieChart>
        </band>
    </summary>
</jasperReport>

而不是

$("#element").bind('click vclick', function(){...}