pg.ddx.io  pgsql-php@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richie <dugganr@student.cs.ucc.ie>
To: pgsql-php@postgresql.org
Subject: Javascript & PHP??
Date: Sat, 10 Mar 2001 17:48:48 +0000 (GMT)
Message-ID: <Pine.OSF.3.96.1010310173050.20390A-100000@student.cs.ucc.ie> (raw)

Hi 

I have a Javascript function which is supposed to open up a seperate 
window with an image from the database. The image location is just stored
on the database and it is returned back from the database no problem. Lets
say I assign a variable $temp to be equal to the location. I then create a
link which when the user clicks it will start a Javascript which is
supposed to read the value of $temp and open up a window accordingly.
However all it does is open up a blank window. Here is my script...

<?
printf("<script language=\"javascript\">");  
printf("function liveWindow(){var 
liveWindow4=window.open(\"$temp\",liveWindow4,\"width=310,height=420,toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,directories=0,status=0,copyhistory=0,maximise=no,left=30,top=30\");}");
printf("</script>"); 
....
and then somewhere further on....

$temp = $currentCombinedRow[15];  //location of image!
printf("<A HREF =\"javascript:onclick=liveWindow()\">Click for
image</A>");

My guess is that the line I give $temp a value is AFTER the Javascript
definition so maybe the Javacript thinks that $temp has no
value yet?? So is this my problem and if so is there any
way around it because Javascript does have to be inside the head doesn't
it? 

Any ideas would be very much appreciated!

Cheers,

Richie
 =========================================================
Richie Duggan 
Computer Science IV
University College Cork
Eamil : dugganr@student.cs.ucc.ie   richie_dug@yahoo.com
Homepage : http://student.cs.ucc.ie/01/dugganr/index.html




view thread (3+ messages)  latest in thread

Message-ID: <Pine.OSF.3.96.1010310173050.20390A-100000@student.cs.ucc.ie>
Permalink:  ../Pine.OSF.3.96.1010310173050.20390A-100000@student.cs.ucc.ie/
Also on:    postgresql.org/message-id/Pine.OSF.3.96.1010310173050.20390A-100000@student.cs.ucc.ie

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-php@postgresql.org
  Cc: dugganr@student.cs.ucc.ie
  Subject: Re: Javascript & PHP??
  In-Reply-To: <Pine.OSF.3.96.1010310173050.20390A-100000@student.cs.ucc.ie>
  References: <Pine.OSF.3.96.1010310173050.20390A-100000@student.cs.ucc.ie>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox