Question
hey,
In twiki3 I used to include:
<script type="text/javascript">
...code
</script>
on top of the editable part of the page and then referring to the proper function.
I want the script to be processed on client site. In twiki3 I just use
<script>Function(paramethers)</script>
to call a function on a page.
In twiki4 this doesn't work unless I put
<pre></pre> tags around
<script>Function(parameters)</script>
Is there a way to keep the old way in twiki4?
I don't know where this can be configured.
Thanks a lot
Environment
--
GrazynaGladys - 19 Mar 2008
Answer
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.
I do not think this is configurable. This is what I typically use to avoid interference by the TWiki rendering engine:
<script type="text/javascript">
<!-- Hide JavaScript and <pre> escape TWiki rendering
... your JavaScript goes here...
// Stop hiding and stop </pre> escaping TWiki rendering -->
</script>
This should work across all TWiki versions.
--
PeterThoeny - 21 Mar 2008
Peter,
I created a page wit this content:
<script type="text/javascript">
<!-- Hide JavaScript and <pre> escape TWiki rendering
function logFiles(strServer)
{
document.write( "Logfiles".link("javascript:OpenPopup('file://" + strServer + "/LogFiles','width=600,height=650,top=20')") );
}
// Stop hiding and stop </pre> escaping TWiki rendering -->
</script>
---++ TWiki3
|*Host*|*Log Files*|
|server1|<script>logFiles("server1")</script>|
|server2|<script>logFiles("server2")</script>|
|server3|<script>logFiles("server3")</script>|
---++ TWiki4
|*Host*|*Log Files*|
|server1|<pre><script>logFiles("server1")</script></pre>|
|server2|<pre><script>logFiles("server2")</script></pre>|
|server3|<pre><script>logFiles("server3")</script></pre>|
This how the page renders using TWiki3
This how the page renders using TWiki4
Basically the TWiki4 version works, but the rendered page looks not really good. I tried using
|server3|<pre><script></pre>logFiles("server3")<pre></script></pre>|
That does not work at all.
Any tips how to solve this?
Thanks
Claus
--
ClausLanghans - 27 Mar 2008
Sorry, closing this question after more than 30 days of inactivity. Feel free to re-open if needed.
--
PeterThoeny - 01 May 2008