Hitachi Vantara Pentaho Community Forums
Results 1 to 3 of 3

Thread: JS Replace function that works into web browser but not into Kettle ?

  1. #1

    Default JS Replace function that works into web browser but not into Kettle ?

    Hello,

    this is working into Firefox, but not into a JS Script step, do you know why ?

    Code:
    var myinfo= '4/100-120';
    var toReplace = new RegExp('-','g');
    var chaineDepart = myinfo.replace(toReplace,'+');
    document.write('test : '+myinfo+' ==> '+chaineDepart);
    Thank you in advance for your help, i'm getting crazy :-)

    Roms

  2. #2
    Join Date
    Nov 1999
    Posts
    9,729

    Default

    I'm guessing that "document" is only valid in the context of a browser.
    What are you trying to accomplish?

  3. #3

    Lightbulb

    Quote Originally Posted by MattCasters View Post
    I'm guessing that "document" is only valid in the context of a browser.
    What are you trying to accomplish?
    I only put these 3 lines with a <script></script> in a .html file and I did test only these 3 lines in a JS step to test...

    I wanted to make multiple replacement + splits in one single step but well, I did create a few steps using dedicated functions.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.