EasyUI Forum
April 27, 2024, 03:25:32 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Error in save function  (Read 8966 times)
marc
Newbie
*
Posts: 2


View Profile
« on: May 21, 2013, 12:30:10 PM »

Please help, I cant able to save or update any data.
And when I check my firebug console its pointing me on the saveUser function.
Please see the text in yellow.

function saveUser(){
         $('#fm').form('submit',{
            url: url,
            onSubmit: function(){
               return $(this).form('validate');
            },
            success: function(result){
               var result = eval('('+result+')');
               if (result.success){
                  $('#dlg').dialog('close');      // close the dialog
                  $('#dg').datagrid('reload');   // reload the user data
               } else {
                  $.messager.show({
                     title: 'Error',
                     msg: result.msg
                  });
               }
            }
         });
      }
Logged
hjzhbb7758
Jr. Member
**
Posts: 84


View Profile Email
« Reply #1 on: May 22, 2013, 01:59:07 AM »

Your console output what?
Logged
marc
Newbie
*
Posts: 2


View Profile
« Reply #2 on: May 22, 2013, 11:49:15 AM »

Quote
SyntaxError: syntax error
[Break On This Error]    

(<br>

(line 55, col 1)

Thats what my console said.
Please help
   
Logged
Kevin
Jr. Member
**
Posts: 52


View Profile Email
« Reply #3 on: June 05, 2013, 01:42:44 AM »

Hi Marc

Check what is being returned in your JSON. This is the issue with eval. For example, the following will generate an error;
eval("x=10;y=20;document.writ(x*y)");

This is because of a spelling mistake in the method 'write'.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!