Charles Collis
charles.collis at gmail.com
Sun Jan 27 18:34:30 EST 2008
Thanks Graham. It now works as intended, although only with Konqueror - Firefox and Safari both blank the page and the URL in address bar goes to http://localhost/python/launch, rather than staying at the page they were on before. Here is the new code as suggested: def launch(req): req.content_type = 'text/plain' raise apache.SERVER_RETURN, apache.OK The only other way I have been able to get it to simulate not leaving the current page is by returning a short bit of html containing some javascript that automatically goes back one page (from the new blank page) - but this is pretty ugly! On Jan 27, 2008 9:12 PM, Graham Dumpleton <graham.dumpleton at gmail.com> wrote: > You still must set the response content type else the browser tries to > work out what to do based on the extension in the URL. So, use: > > req.content_type = 'text/plain' > > Graham > > On 28/01/2008, Charles Collis <charles.collis at gmail.com> wrote: > > Hi. > > > > I wonder if anyone can help - I am having problems getting the Publisher > > handler to return nothing. > > > > I am wanting the publisher handler to return nothing when clicking on a > link > > that points to a particular function which will perform a system > command, > > and I am using the recommended 'raise apache.SERVER_RETURN, apache.OK' > > trick. > > > > This does indeed stop the page contents refreshing, but has the odd > > side-effect of the browser asking wanting to download a file (of 'python > > script' type). This behaviour happens in both Firefox 3 beta2 and > Konqueror. > > It even does it if the function doesn't do anything: > > > > def launch(): > > pass > > raise apache.SERVER_RETURN, apache.OK > > > > I am running Ubuntu Gutsy. > > > > Apache and mod_python details: > > Apache/2.2.4 (Ubuntu) mod_python/3.3.1 Python/2.5.1 PHP/5.2.3-1ubuntu6.3 > > > > Any pointers appreciated. Thanks. > > > > Charles Collis. > > > > _______________________________________________ > > Mod_python mailing list > > Mod_python at modpython.org > > http://mailman.modpython.org/mailman/listinfo/mod_python > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20080127/b3a97931/attachment.html
|