User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 456,530 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,779 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 5255 | Replies: 4
Reply
Join Date: Aug 2007
Location: Iloilo City Philippines
Posts: 17
Reputation: tagz017 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
tagz017 tagz017 is offline Offline
Newbie Poster

Question auto refresh

  #1  
Oct 5th, 2007
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
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jul 2006
Location: Deptford, London
Posts: 971
Reputation: MattEvans has a spectacular aura about MattEvans has a spectacular aura about 
Rep Power: 5
Solved Threads: 48
Moderator
Featured Poster
MattEvans's Avatar
MattEvans MattEvans is offline Offline
Posting Shark

Re: auto refresh

  #2  
Oct 5th, 2007
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..
Plato forgot the nullahedron..
Reply With Quote  
Join Date: Aug 2007
Location: Iloilo City Philippines
Posts: 17
Reputation: tagz017 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
tagz017 tagz017 is offline Offline
Newbie Poster

Re: auto refresh

  #3  
Oct 5th, 2007
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
Reply With Quote  
Join Date: Jul 2006
Location: Deptford, London
Posts: 971
Reputation: MattEvans has a spectacular aura about MattEvans has a spectacular aura about 
Rep Power: 5
Solved Threads: 48
Moderator
Featured Poster
MattEvans's Avatar
MattEvans MattEvans is offline Offline
Posting Shark

Re: auto refresh

  #4  
Oct 5th, 2007
Yep. Change the code to:
  1. print "<script type=\"text/javascript\">window.opener.location.reload(); </script>";
or
  1. 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..
Plato forgot the nullahedron..
Reply With Quote  
Join Date: Aug 2007
Location: Iloilo City Philippines
Posts: 17
Reputation: tagz017 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
tagz017 tagz017 is offline Offline
Newbie Poster

Re: auto refresh

  #5  
Oct 7th, 2007
Thanks MattEvans
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb JavaScript / DHTML / AJAX Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the JavaScript / DHTML / AJAX Forum

All times are GMT -4. The time now is 4:24 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC