On Wednesday, January 21, 2015 at 6:09:26 AM UTC-8, Anthony wrote:
>
> On Tuesday, January 20, 2015 at 10:45:53 PM UTC-5, Dave S wrote:
>>>
>>> As mentioned in another thread, I started using
>>>
>>>
>>> TAG.BUTTON('"label" _type="submit", _name="mybutton", 
>>> _value=buttonvalue,
>>>                              _onclick='ajax("stuff.load", ["val1","val2"
>>> , "val3"], "stuff_div")')
>>>
>>>
>> and "stuff.load" is a relative URL, so it will simply be appended to the 
>> URL of the page (which may work fine if the page in question happens to be 
>> the default function for the controller and the function is not included in 
>> the URL).
>>
>>
> Both the function for the page with the button and function the button 
> loads (that is, stuff()) are in the default.py controller, and the relative 
> URL is working for me, as long as javascript is enabled [author studies 
> ceiling for a moment].
>

If the URL of the containing page is something like 
http://yourdomain.com/default/parent (i.e., where "parent" is a function in 
the default.py controller), then the "stuff.load" relative URL would make a 
request to http://yourdomain.com/default/parent/stuff.load, which 
presumably would not work. On the other hand, if you have "parent" set as 
the default function for the default.py controller and the page URL is 
instead just http://yourdomain.com/default/ (or even just 
http://yourdomain.com/), then your relative URL will work -- but it will 
break if you change the default function or include an ambiguous URL arg.

Anthony

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to