0

why this script is not running on my php files but its running on other computers.

<script type="text/javascript">window.opener.location.reload(); </script>";


thanks in advance.

- tagz017

2
Contributors
4
Replies
5
Views
10 Years
Discussion Span
Last Post by tagz017
0

Are you escaping the quotes ( " ) ?

should be <script type=\"text/javascript\">window.opener.location.reload(); </script> - if you're putting it in a doublequoted sring; which it appears you are, looking at the last 2 characters..

0

sorry i forgot.. i'm printing this script on a php code. it should be

print "<script type="text/javascript">window.opener.location.reload(); </script>";

i'm not familiar with dll's need your help on this one too. i'm using php version 5.

thnx

0

Yep. Change the code to:

print "<script type=\"text/javascript\">window.opener.location.reload(); </script>";

or

print "<script type='text/javascript'>window.opener.location.reload(); </script>";

If you don't escape the quotes within a string; the parser will think that the string ends early. i.e, it will get to
"<script type=" and then get confused. In this context, putting a \ character means 'ignore the next character', and using single quotes inside the string rather than double quotes stops the parser thinking that your inner-string quotes are end-of-string quotes..

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.