How to debug (show errors) on a system that uses Mootools?

Asked

Viewed 65 times

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(?).

  • 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.

  • 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...

  • Will this be it? $(document).find('body').append(frame);&#xA;var f = $(new Element('form'));&#xA;f.attr('action',webroot('Imagens/upload_avulsa'));&#xA;f.attr('target','upload_frame');&#xA;f.attr('method','post');&#xA;f.attr('enctype','multipart/form-data');&#xA;f.append($(this));&#xA; &#xA;$(document).find('body').append(f);&#xA;f.submit();

  • 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.

  • This is the code of the full page: https://jsfiddle.net/tohko3vn/1/

  • This code is basically jQuery, has almost nothing of Mootools. This site is online? to see the answer in the console?

  • You managed to solve the problem?

Show 3 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.