> At this moment I have this piece of code.
> // <![CDATA[
> if ((navigator.userAgent.indexOf('iPhone') != -1) ||
> (navigator.userAgent.indexOf('iPod') != -1) ||
> (navigator.userAgent.indexOf('iPad') != -1))
> { config.shadowTiddlers.MarkupPreHead='[[IphoneMarkupPreHead]]';
> } // ]]>
> But I don't know if is correct.
That code will not work... and shows a misunderstanding about the
MarkupPreHead content
First....
you CANNOT make reference ANY TiddlyWiki runtime variable (such as
config.shadowTiddlers.*). When the content injected into the source
file from MarkupPreHead is processed, the TiddlyWiki code has NOT been
invoked yet, so NONE of the TW runtime data exists!
Second...
Even if you could re-assign the value of the MarkupPreHead SHADOW
tiddler, that content is not *processed* during startup. The
processing occurs on a COPY of that content that was injected into the
source file when the document was *previously* saved.
Third...
The content you assigned into the shadow was simply a TiddlyWiki-
syntax *link* to a named tiddler. As noted before, you CANNOT use
TiddlyWiki syntax in the Markup* tiddlers, because their content is
processed directly by the browser, without the availability of the
TiddlyWiki run time code. In any event, even if this syntax was
supported, it would NOT *invoke* the content from IPhoneMarkupPreHead,
but simply place a TiddlyLink into the output.
What you need to do it to put the conditional statement AND *all* the
code it invokes *directly* into the MarkupPreHead tiddler, and don't
use any TW syntax or try to access TW run-time data from within that
code.
-e
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/tiddlywiki?hl=en.