I’m generating some script tags that reference JavaScript in my
content. The JavaScript is not external but part of the database
content, and is rendered with a layout that gives it the
text/javascript mime type.
I cannot get (when using XHTML Transitional) my JavaScript to run
because the browsers are not fetching the URL constructed by my
<r:url/> tag. Here are the generated script tags:-
I think the browser doesn’t want the URLs to end in a / when in an
XHTML document. Does anyone know what I can do here?
I think it has to do with having your Radius tags inside an XHTML tag.
Correct me if I’m wrong, John, but it won’t parse them inside tags or
their
attributes?
You might be better off just linking to them statically, or writing a
tag
definition to do it for you.
I was loading ‘library’ Javascript and writing glue code for each
actual page to tailor the library to the content I am generating
(using JavaScript to generate CSS, SVG, table layout in my DOM).
So after my first two tags, which I verified are working properly, I
have an inline script element that doesn’t load its JavaScript content
from an external source. Here is a small test case explaining this.
<?xml version="1.0" encoding="utf-8"?>
If you load that from inside the browser, it doesn’t call the alert
function. However, if you remove the first two lines (XML declaration,
the CDATA stuff, above and below the hello lines), it works fine.
Put them back in and it stops working. Unless you create new layout
and assign it a text/xml mime type. So in the end the problem with my
scripts not being called is that I was serving XHTML as text/html and
not as text/xml … and as a result, any content inside the CDATA
section was being ignored (probably it was trying to parse it as a
tag?).
I think it has to do with having your Radius tags inside an XHTML tag.
Correct me if I’m wrong, John, but it won’t parse them inside tags or their
attributes?
It will parse tags inside of HTML attributes. What it can’t parse is
tags inside of Radius tag attributes.