Tags:
create new tag
view all tags
Ok, I understand the debate where some people don't want javascript at all as part of Twiki. Fine. But for those of us who do want to use it, it would make things A LOT easier if TWiki would simply not recognize TWiki words between <SCRIPT> tags.

For example, I wanted to check to see if a value was an integer. In Javascript, if it isn't, it returns NaN. So I couldn't do...

var numberCheck = parseInt(this.myForm.ChapterIn.value);
if (numberCheck == 'NaN')
{ alert("Enter a valid chapter");
  return;
}

at all. I had to totally hack it by doing this...

var numberCheck = parseInt(this.myForm.ChapterIn.value);
numberCheck += 'x';
if (numberCheck == 'NaNx')
{ alert("Enter a valid chapter");
  return;
}

Then I had even more fun trying to do a loop...

for (i = 0; i < 10; i++)
{ ...
}

...because TWiki tries to be nice and convert the '<' into a &gt;

Again, all these problems go away if we just ignore all TWiki in between script tags!

-- MattWalsh - 20 Dec 2001

We have a similar issue with <verbatim> tags. I wrote a fix for that, perhaps this could be generalised for a range of tags that can be specified via a preference.

-- JohnTalintyre - 20 Dec 2001

Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r2 - 2001-12-20 - JohnTalintyre
 
  • 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.