Tags:
create new tag
view all tags

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

TWiki version: TWikiRelease04x01x00
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: unix
Web server: apache 2
Perl version: 5.8
Client OS:  
Web Browser:  
Categories: Javascript

-- GrazynaGladys - 19 Mar 2008

Answer

ALERT! 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
script_twiki3_render.gif

This how the page renders using TWiki4
script_twiki4_render.gif

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

Change status to:
Topic attachments
I Attachment History Action Size Date Who Comment
GIFgif script_twiki3_render.gif r1 manage 9.6 K 2008-03-27 - 19:23 UnknownUser  
GIFgif script_twiki4_render.gif r1 manage 7.9 K 2008-03-27 - 19:23 UnknownUser  
Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r5 - 2008-05-01 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.