起步软件技术论坛
搜索
 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1905|回复: 1

[暂结贴(7天未回复)] Wex5中使用jquery原生代码

[复制链接]

13

主题

32

帖子

60

积分

初级会员

Rank: 2

积分
60
QQ
发表于 2016-3-5 21:51:26 | 显示全部楼层 |阅读模式
本帖最后由 wmnmtm 于 2016-3-5 21:57 编辑

<div component="$UI/system/components/justep/output/output" class="x-output" xid="output5" id="output5"></div>
<div id="span88" style="border:1px solid red;">---</div>
<input type="text" value="0000" xid="input2" id="input2" style="width:247px;"></input>


define(function(require){
        var $ = require("jquery");
        var justep = require("$UI/system/lib/justep");

        var Model = function(){
                this.callParent();
               
                $("#input2").val(22222);//代码1
               
                $("#span88").html('123');//代码2
               
                $("#output5").html('abc');//代码3
        };

        return Model;
});


其中代码3不生效,执行效果如下:
QQ截图20160305214545.jpg



如果要让代码3生效,需要删除上面红色的代码,让div变为普通的html

component="$UI/system/components/justep/output/output"改为:
<div class="x-output" xid="output5" id="output5"></div>


执行效果为:
QQ截图20160305215110.jpg
从这次测试可以看到,jquery对指定了component的html无效,是否一直是这样,就不知道了。







12

主题

2627

帖子

2866

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
2866
发表于 2016-3-6 09:35:51 | 显示全部楼层
把output组件的id="output5"属性删除, js中改成
var outputId = this.getIDByXID("output");
$("#" + outputId).html("abc");
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|X3技术论坛|Justep Inc.    

GMT+8, 2024-5-17 10:55 , Processed in 0.087014 second(s), 26 queries .

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表