留言板

Regarding Ajax

Praveenraj S,修改在6 年前。

Regarding Ajax

Junior Member 帖子: 28 加入日期: 16-7-20 最近的帖子
Hi

How to load Script src(external/ internal ) in Ajax Success function,
i tried like this

dataType:'json',
on: {
success: function() {

$('#formTab').empty();
var tableData =this.get('responseData');
for(var i in tableData){
$('#formTab').append(tableData.tableValue);
document.getElementById('formTab').src = 'http://code.jquery.com/ui/1.11.4/jquery-ui.min.js';
document.getElementById('formTab').src = 'http://code.jquery.com/ui/1.11.4/jquery-ui.min.js';
$('th').draggable
(
{

helper: 'clone',

revert: false
}
);

$(".drop").droppable
(
{
drop: function (event, ui)
{
this.value = $(ui.draggable).text();
}
}
);



It shows error in Console like

Uncaught TypeError: $(...).draggable is not a function
at y.success (scheduler:1)
at c.Subscriber._notify (everything.jsp:1)
at c.Subscriber.notify (everything.jsp:1)
at c.CustomEvent._notify (everything.jsp:1)
at c.CustomEvent._procSubs (everything.jsp:1)
at c.CustomEvent.g.fireComplex (everything.jsp:1)
at c.CustomEvent._fire (everything.jsp:1)
at y.fire (everything.jsp:1)
at y._success (everything.jsp:3)
at YUI.<anonymous> (everything.jsp:1)



Thanks in Advance
thumbnail
Andrew Jardine,修改在6 年前。

RE: Regarding Ajax

Liferay Legend 帖子: 2416 加入日期: 10-12-22 最近的帖子
Hi Praveenraj,

I'm not sure exactly what you are trying to do -- which version of Lifeary, where or not this is in the context of an AUI module, etc. but I have used the "get" YUI module in the past to load JS resources. Have a look at this -- https://yuilibrary.com/yui/docs/get/