Is it possible to pop up window from a json line.
Example, this link works fine:
$json['msg'] = 'Welcome. Please, <a href="http://mylink/?chat_session='.$rows['id'].'">click here</a>!';
But when I tried to create a pop up for it, it says errors T string parsing, things like that.
For my pop up I tried using:
<script language="javascript" type="text/javascript"><!--function mbetter(url) {
newwindow=window.open(url,'name','height=600,width=550');
if (window.focus) {newwindow.focus()}
return false;}// --></script>
and for link
$json['msg'] = 'Welcome. Please, <a href="#" onClick="return mbetter('http://mylink/?chat_session='.$rows['id'].'')">click here</a>!';
What could be causing this issue?
This is a problem with escaping a string.
Should be:
Notice how I have escaped the single quotes in your JavaScript with backslashes?
This is described in the PHP manual on the Strings page: