|
Posted by Ian Collins on 01/19/06 10:16
one man army wrote:
>
> hmmm, that is the Javascript part. Perhaps I will expand on this..
>
> * I have a very simple HTML page, with a FORM, with an INPUT TEXT
> * there is a button that activates some javascript
> * the javascript causes this to happen
>
> // Create new JS element
> var jsel = document.createElement('SCRIPT');
> jsel.type = 'text/javascript';
> jsel.src = url;
>
> // Append JS element (therefore executing the the PHP call)
> document.body.appendChild (jsel);
>
> url points to a PHP file! the appendChild has the effect of causing the
> script to be executed. Apparently the broswer thinks it is Javascript,
> so the javascript in it runs, but the suffix is .php, so the server sees
> it , and the PHP runs. Really, it works.
>
It thinks it's JavaScript because you tell it it is...
The PHP script runs when you open the page.
So your browser's JavaScript interpreter attempts to run the output from
the PHP.
Bit of a mess.
--
Ian Collins.
Navigation:
[Reply to this message]
|