Foros de discusión

Regarding Ajax

Praveenraj S, modificado hace 6 años.

Regarding Ajax

Junior Member Mensajes: 28 Fecha de incorporación: 20/07/16 Mensajes recientes
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, modificado hace 6 años.

RE: Regarding Ajax

Liferay Legend Mensajes: 2416 Fecha de incorporación: 22/12/10 Mensajes recientes
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/