Re: Re: Preserving base tag?
from
ianb
on 2008-05-13 15:34
Kevin Teague wrote:
>> Regarding the <base> node getting removed when turning on content link
>> rewriting....what would you say is the correct behavior? I think it
>> is natural to remove it when converting links to absolute URLs, right?
>>
>> Regarding that Kupu JS snippet, it looks like it is doing the right
>> thing. Meaning, it is handling the case where there is no <base>
>> node. Can you show us the error in the JS console?
>>
>
> The Javascript error is triggered by clicking on the [HTML] button. The error
> I get is (and it comes from the file kupuploneeditor.js):
>
> Error: /.*\/([^\/]*)$/.exec(base) has no properties
> Source File:
> http://localhost:8000/systems/portal_javascripts/GSC%20GIN/kupunoi18n-cachekey7942.js
> Line: 292
>
> If converting links to absolute URLs, I would say leave the base tag in
> anyways since scripts may rely upon it. It's redundant, but it's not causing
> any harm is it?
It seems like a weird artifact to be looking for. I guess you can kind
of rely on it in Zope, but it's a weird Zope-ism that few other products
use. In this case, I'm guessing location.href should be used when the
base tag isn't present (or... maybe stripping the last segment of
location.href).
Ian