From: "Stan" on
It works like it is ... once. What I don't understand is why the client
browser(s I have tried it with Firefox and IE 6) can't find the Javascript
function the second time.


From: Ashley Sheridan on
On Tue, 2010-02-23 at 05:55 -0600, Stan wrote:

> It works like it is ... once. What I don't understand is why the client
> browser(s I have tried it with Firefox and IE 6) can't find the Javascript
> function the second time.
>
>
>


I've had a look, but I'm not sure what you're trying to achieve with
your Javascript. The .js files seem to be present in the page even after
entering dummy access details into the page. You said you're using PHP
to modify what gets put into the .js file. Are you maybe modifying it in
a way that breaks the javascript?

Thanks,
Ash
http://www.ashleysheridan.co.uk


From: Rene Veerman on
On Tue, Feb 23, 2010 at 1:03 PM, Ashley Sheridan
<ash(a)ashleysheridan.co.uk> wrote:
> Are you maybe modifying it in
> a way that breaks the javascript?
>
that would be my guess too... firefox + firebug will often give
accurate error messages for badly formed js.

the error itself is known to be caused by malformed js unable to be
parsed by the browser.
ie(8) does more js syntax nagging than most other browsers.
From: "Stan" on
Thanks all.

I rediscovered DIFF, compared the source for the first and second rendering.
Besides the unique variable names there was also the message ... which
contained imbedded single quote marks. When I changed them to imbedded
double quote marks the problem went away.

""Stan"" <stanleytberry(a)gmail.com> wrote in message
news:11.66.00376.2CE928B4(a)pb1.pair.com...
> I have a PHP page that has
> require_once("genMyOverlay.js.php");
> .
> .
> .
> echo "<body>";
> echo "<script language=\"JavaScript\">doit(\"mydiv\");</script><br>";
> echo "</body>";
>
> genMyOverlay.js.php contains: createDiv() (see below) that creates a <DIV
> 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
> <script language="PHP">
> echo "<script language=\"JavaScript\">";
> echo "function createDiv()";
> echo " {";
> .
> .
> .
> echo " }";
> echo "function doit(ElementID)";
> echo " {";
> echo " creatDIV()";
> .
> .
> .
> echo " }";
> echo "</script>";
> </script>
>
>


First  |  Prev  | 
Pages: 1 2
Prev: Fun with Streams
Next: $_POST vs $_REQUEST