title: method plugin doesn't work within Function Constructor
body: <p>What I'm trying to achieve in JavaScript is to make a method of the plugin I'm working with (called &quot;Plugin&quot;) flexible. The plugin runs in an iFrame and has cross-domain trust settings applied. I want to use variables to build the method parameter rather than hard code it.</p>
  <p>The <strong>hardcoded version</strong> is shown below and I've double checked this works. I've used it in functions and in a Function constructor. Both work.<br/></p>
  <pre><code>    window.Plugin.Session.Tags({ 
      TagName: 'SomeTagName',
      TagValueTagging: 'sometagvalue; secondtagvalue',
      TagValueTaggingReset: '*'
      }).Update();
  </code></pre>
  <p><br/><br/>
  My objective is to replace the 'sometagvalue' with a variable, so I can set the tag dynamically. The help says the parameter is a constant JSON string. <br/><br/>
  I've tried the following things:</p>
  <ol>
  <li>build the <strong>parameter as string</strong>. <strong>Result:</strong> Though myText holds the exact same string as in the hardcoded version, the method is not executed.<br />
  <br/></li>
  </ol>
  <pre><code>    var myTag = '\\'DEELNEMER ; name\\' ';
      var myText = &quot;{TagName : 'Workflow',&quot; +
      &quot; TagValueTagging : &quot; + myTag  +
      &quot;, TagValueTaggingReset : '*'}&quot;;
      alert(&quot;myText = &quot; + myText);
      x = window.Plugin.Session.Tags(myText);
      x.Update();
  </code></pre>
  <p><br/><br/>
  2) using new <strong>Function constructor</strong>. I created a variable with the session object and inserted that as parameter. In order to proof myself that I working with the right object, I've put it's LID in an alert as well outside as inside the constructor. <strong>Result:</strong> the Session.LID was the same inside and outside the constructor, but tagging did not happen. <br/>
  <br/></p>
  <pre><code>    var myFunction = &quot;alert(\&quot;in constructor Session.LID = \&quot; + prmSession.LID); window.addTag = 
      prmSession.Tags({TagName : \'Workflow\', TagValueTagging : \'DEELNEMER\' , TagValueTaggingReset : 
      \'*\'}); window.addTag.Update();&quot; 
      var addTagFunction = new Function(&quot;prmSession&quot;, myFunction)
      var prmSession = window.Plugin.Session;
      alert(&quot;in main function Session.LID = &quot; + prmSession.LID);
      addTagFunction(prmSession);
  </code></pre>
  <p><br/><br/>
  3) using <strong>JSON stringify</strong>. Again <strong>Result:</strong> Tag was not set, in neither variant..
  <BR/></p>
  <pre><code>    var myTag = 'DEELNEMER ; name ';
      var obj = new Object();
      obj.TagName = &quot;Workflow&quot;;
      obj.TagValueTagging = myTag;
      obj.TagValueTaggingReset = &quot;*&quot;;&lt;br/&gt;
      var myJSON= JSON.stringify(obj);
      Plugin.Session.Tags(myJSON).Update();&lt;br/&gt;
      /*variant 2*/&lt;br/&gt;
      var myObjParsed = JSON.parse(myJSON);
      Plugin.Session.Tags(myObjParsed).Update();
  </code></pre>
  <p><br/><br/>
  I would be very greatful for a tip how to solve this issue.<br/>
  Regards</p>