title: Open new page/tab and add content
body: <p>I read many posts but i couldn't find an answer to my question. I have a button on a webpage which is linked to a controller. This controller prepares some data and calls the view. In the view I have a php variable with this data.</p>
  
  <p>I want to open a new page/tab and add the content of my php variable. The content of the variable is a SVG string which is readable by all browsers. </p>
  
  <p>I know this is not possible in php. I need to use JavaScript, but how can i add the content of a php variable to a new tab???</p>
  
  <p><strong>Note:</strong> I have the string only in the php variable not in a file and I don't want to click again on a link to open a new tab.</p>
  
  <p>Any ideas or solutions?</p>
  
  <p>According to the first answer an example (doesnt work:()</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;
          Test file
      &lt;/title&gt;
      &lt;script&gt;
          var myWindow = window.open('','_newtab');
          myWindow.document.write($('myString').text());
  
      &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;p style="display:none" id="myString"&gt;Das kommt auch auf die neue seite&lt;/p&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p></p>