如何将html添加ajax,如何将jQuery添加到从ajax调用加载的html中?

Connected as user : Tony

You selected the procedure : lg_resultsretrieval

Enter procedure input variables :

Parameter1: starttime - timestamp without time zone

Parameter2: endtime - timestamp without time zone

Parameter3: in_sourceindicator - integer

Parameter4: keyword - character varying

我写了一个jQuery函数的文字区域的:

这个div,使一个AJAX调用一个servlet后,作为附加如下:

//submits only when the textbox value is valid

$("#response").on("change", function() {

$("#Execute").click(function() {

if ($(".txtarea").val() == this.defaultValue)

{

alert("Please insert a valid value");

return false;

}

});

$("txtarea")

.focus(function() {

if (this.value === this.defaultValue) {

console.log('inside focus function');

this.value = '';

}

})

.blur(function() {

if (this.value === '') {

this.value = this.defaultValue;

}

});

});

问题是,上面的代码不虽然jquery的文档中工作,它表示对函数用于动态加载的Elemen TS。我如何使它工作?请建议

2014-03-12

Karthik

+0

1)不存在与元素的id'Execute' 2)没有标签'txtarea'的元素 –

+0

DIVS没有变化事件。 –

+0

@epascarello:尽管如此,'change'事件似乎传播到子元素的'div'元素。在这种情况下'textarea'元素。也许这是特定于浏览器的行为?值得测试,我想。 –

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值