Re: [web2py] Re: LOAD: ajax_trap errors... (still in 1.96.1)
tracked in http://code.google.com/p/web2py/issues/detail?id=284 On Fri, Jun 3, 2011 at 1:44 AM, ron_m ron.mco...@gmail.com wrote: I figured out the problem. The Javascript generated looks like this: web2py_trap_form('('/app/default/testajax.load',)','c831268503949'); which is illegal because the single quotes around the URL terminate the single quotes of the first parameter for web2py_trap_form It looks like a string '(' then /app/default. is no longer inside quotes. Line 148 of compileapp.py in version 1.96.1 has the line js = web2py_trap_form('%s','%s'); % (link, target) I traded the quotes around in the Python code like so js = 'web2py_trap_form(%s,%s);' % (link, target) so the output would change to look like web2py_trap_form(('/app/default/testajax.load',),c831268503949); which is legal Javascript and now I get no errors. A second question is why the link is a set, the output formating seems to indicate that. I don't know enough to know whether the first element should be dereferenced e.g. link[0] instead of just link. Then there would not be 2 sets of single quotes atcked in the output. Ron -- Sebastian E. Ovide
[web2py] Re: LOAD: ajax_trap errors... (still in 1.96.1)
fixed. there was an unwanted comma in the code. On Jun 3, 3:16 am, Sebastian E. Ovide sebastian.ov...@gmail.com wrote: tracked inhttp://code.google.com/p/web2py/issues/detail?id=284 On Fri, Jun 3, 2011 at 1:44 AM, ron_m ron.mco...@gmail.com wrote: I figured out the problem. The Javascript generated looks like this: web2py_trap_form('('/app/default/testajax.load',)','c831268503949'); which is illegal because the single quotes around the URL terminate the single quotes of the first parameter for web2py_trap_form It looks like a string '(' then /app/default. is no longer inside quotes. Line 148 of compileapp.py in version 1.96.1 has the line js = web2py_trap_form('%s','%s'); % (link, target) I traded the quotes around in the Python code like so js = 'web2py_trap_form(%s,%s);' % (link, target) so the output would change to look like web2py_trap_form(('/app/default/testajax.load',),c831268503949); which is legal Javascript and now I get no errors. A second question is why the link is a set, the output formating seems to indicate that. I don't know enough to know whether the first element should be dereferenced e.g. link[0] instead of just link. Then there would not be 2 sets of single quotes atcked in the output. Ron -- Sebastian E. Ovide
[web2py] Re: LOAD: ajax_trap errors... (still in 1.96.1)
Verified fixed in 1.96.2
[web2py] Re: LOAD: ajax_trap errors... (still in 1.96.1)
I figured out the problem. The Javascript generated looks like this: web2py_trap_form('('/app/default/testajax.load',)','c831268503949'); which is illegal because the single quotes around the URL terminate the single quotes of the first parameter for web2py_trap_form It looks like a string '(' then /app/default. is no longer inside quotes. Line 148 of compileapp.py in version 1.96.1 has the line js = web2py_trap_form('%s','%s'); % (link, target) I traded the quotes around in the Python code like so js = 'web2py_trap_form(%s,%s);' % (link, target) so the output would change to look like web2py_trap_form(('/app/default/testajax.load',),c831268503949); which is legal Javascript and now I get no errors. A second question is why the link is a set, the output formating seems to indicate that. I don't know enough to know whether the first element should be dereferenced e.g. link[0] instead of just link. Then there would not be 2 sets of single quotes atcked in the output. Ron