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.
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.
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???
Note: 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.
Any ideas or solutions?
According to the first answer an example (doesnt work:()
<html>
<head>
<title>
Test file
</title>
<script>
var myWindow = window.open('','_newtab');
myWindow.document.write($('myString').text());
</script>
</head>
<body>
<p style="display:none" id="myString">Das kommt auch auf die neue seite</p>
</body>