1
all right?
I don’t know JS in depth, but I need to debug a chunk of code that uses Mootools. When I tell my code to write an array with print_r or debug (from cakephp), I don’t see anything and the console looks like this:
SyntaxError: expected expression, got '<'
(<pre class="cake-error"><a href="javascript:void(0);" onclic
cakephp tries to display the error, but ajax/js/mootools (I don’t know which) hides the error, not letting it appear.
Can anyone help me? Thank you! =)
+1
for using Mootools :) Can you input the Mootools code you have? I imagine you have a Request class(?).– Sergio
Actually, Sergio, the code is all in PHP. However, as the system uses Mootools, it seems that it blocks the error display through ajax in some way. This code is what appears on the console.
– michelmfreitas
But what is the Mootools code that makes an ajax request? You must have a Request (the ajax class). Without that you can’t even know what ajax request you’re sending and what kind of data is being expected...
– Sergio
Will this be it?
$(document).find('body').append(frame);
var f = $(new Element('form'));
f.attr('action',webroot('Imagens/upload_avulsa'));
f.attr('target','upload_frame');
f.attr('method','post');
f.attr('enctype','multipart/form-data');
f.append($(this));
 
$(document).find('body').append(f);
f.submit();
– michelmfreitas
It’s not that stretch. And I’m seeing in this Mootools Trech mixed with jQuery, that’s not good. If you put all the code in a question or jsFiddle I can help more.
– Sergio
This is the code of the full page: https://jsfiddle.net/tohko3vn/1/
– michelmfreitas
This code is basically jQuery, has almost nothing of Mootools. This site is online? to see the answer in the console?
– Sergio
You managed to solve the problem?
– Sergio