Re: IE6 and .js include problem?
Thomas 'PointedEars' Lahn wrote:
[color=blue]
> Randy Webb wrote:
>[color=green]
>>Thomas 'PointedEars' Lahn wrote:
>>[color=darkred]
>>>Randy Webb wrote:
>>>
>>>>Thomas 'PointedEars' Lahn wrote:
>>>>
>>>>>>To solve it, I had to use PHP as:
>>>>>><script > <? include ('myfile.js'); ?> </script>
>>>>>
>>>>>This will cause a server-side script error.
>>>>
>>>>Think first, code second, test third, post to News fourth.
>>>>It does *not* cause server side script errors.
>>>
>>>But it is likely to and thus it is bad practice. The JavaScript
>>>only needs to contain "<?" or "<?php" (for whatever reason) and
>>>the hypertext preprocessor will parse it.[/color]
>>
>>Perhaps you should gain access to a PHP-enabled server and test it out.[/color]
>
>
> I *have* already access to a PHP-enabled server at http://localhost/
> and I am well-versed in PHP, thank you.[/color]
Obviously not, or you would realize that the only files that the PHP
parser parses are files that are dictated in the configuration files for
PHP to process, and by default .js files are not parsed, so any PHP
commands in a .js file will not be parsed.
[color=blue]
>[color=green]
>>This code:
>>
>><script> <?php include ('blank1.js'); ?> </script>
>>
>>And in blank1.js:
>>
>>notLoaded = false;
>><? ... ?>
>><?php ... ?>
>>
>>Causes *NO* PHP errors, it throws the appropriate JS errors though.[/color]
>
>
> Of course. I was referring to accidental character sequences in
> JavaScript code. Don't be stupid![/color]
You said it would cause an error, I proved you wrong. I would hardly
call that "being stupid".
[color=blue]
>[color=green]
>>Perhaps you should peruse the www.php.net site and learn how it handles
>>the include statement.[/color]
>
>
> Perhaps you should create test cases which reflect what I am saying.[/color]
No, I won't create test cases to back up your arguments, I provided one
that shows that you are utterly wrong. So, let me repeat what I said.
Peruse the PHP site and learn how the include statement works.
--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq/
Thomas 'PointedEars' Lahn wrote:
[color=blue]
> Randy Webb wrote:
>[color=green]
>>Thomas 'PointedEars' Lahn wrote:
>>[color=darkred]
>>>Randy Webb wrote:
>>>
>>>>Thomas 'PointedEars' Lahn wrote:
>>>>
>>>>>>To solve it, I had to use PHP as:
>>>>>><script > <? include ('myfile.js'); ?> </script>
>>>>>
>>>>>This will cause a server-side script error.
>>>>
>>>>Think first, code second, test third, post to News fourth.
>>>>It does *not* cause server side script errors.
>>>
>>>But it is likely to and thus it is bad practice. The JavaScript
>>>only needs to contain "<?" or "<?php" (for whatever reason) and
>>>the hypertext preprocessor will parse it.[/color]
>>
>>Perhaps you should gain access to a PHP-enabled server and test it out.[/color]
>
>
> I *have* already access to a PHP-enabled server at http://localhost/
> and I am well-versed in PHP, thank you.[/color]
Obviously not, or you would realize that the only files that the PHP
parser parses are files that are dictated in the configuration files for
PHP to process, and by default .js files are not parsed, so any PHP
commands in a .js file will not be parsed.
[color=blue]
>[color=green]
>>This code:
>>
>><script> <?php include ('blank1.js'); ?> </script>
>>
>>And in blank1.js:
>>
>>notLoaded = false;
>><? ... ?>
>><?php ... ?>
>>
>>Causes *NO* PHP errors, it throws the appropriate JS errors though.[/color]
>
>
> Of course. I was referring to accidental character sequences in
> JavaScript code. Don't be stupid![/color]
You said it would cause an error, I proved you wrong. I would hardly
call that "being stupid".
[color=blue]
>[color=green]
>>Perhaps you should peruse the www.php.net site and learn how it handles
>>the include statement.[/color]
>
>
> Perhaps you should create test cases which reflect what I am saying.[/color]
No, I won't create test cases to back up your arguments, I provided one
that shows that you are utterly wrong. So, let me repeat what I said.
Peruse the PHP site and learn how the include statement works.
--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq/
Comment