help, please, understanding my problem

help, please, understanding my problem

am 22.02.2010 16:09:14 von Stan

I have a PHP page that has
require_once("genMyOverlay.js.php");
.
.
.
echo "";
echo "
";
echo "";

genMyOverlay.js.php contains: createDiv() (see below) that creates a ID="mydiv"> and sets it up to overlay a portion of the wbe page and
doit()starts it off.

invoke the web page once and it works like it should. invoke the web page a
second time (and thereafter until a new session) and it gets error:
"doit is not defined"

view the source (at the client browser) and it is identical both (all) times

can anyone please help me understand what is happening?

genMyOverlay.js.php contains
";




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: help, please, understanding my problem

am 22.02.2010 16:15:14 von Ashley Sheridan

--=-alo6xNGmbS1AfvBztooW
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

On Mon, 2010-02-22 at 09:09 -0600, Stan wrote:

> I have a PHP page that has
> require_once("genMyOverlay.js.php");
> .
> .
> .
> echo "";
> echo "
";
> echo "";
>
> genMyOverlay.js.php contains: createDiv() (see below) that creates a > ID="mydiv"> and sets it up to overlay a portion of the wbe page and
> doit()starts it off.
>
> invoke the web page once and it works like it should. invoke the web page a
> second time (and thereafter until a new session) and it gets error:
> "doit is not defined"
>
> view the source (at the client browser) and it is identical both (all) times
>
> can anyone please help me understand what is happening?
>
> genMyOverlay.js.php contains
> ";
>
>
>
>


Going on just that sample, there's no issue. As it works the first time,
there isn't a problem with it not getting included. Have you tried it on
other browsers to see what happens there? Also, Firefox has a brilliant
addon called Firebug, which can show you the contents of included .js
files on your page, which will show up any problems you may have.

Aside from these points, have you a good reason for including a PHP file
that just outputs javascript? Why not just include the .js file as part
of the header?

Also, your script tags need a type attribute:

";
>
>
>



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php