#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2001
    Location
    entlegen
    Posts
    442
    Rep Power
    13

    why it is won't work php in javascript....


    <SCRIPT LANGUAGE='JavaScript' src='../display-position2.php?q_refno=$q_refno1'>

    </SCRIPT>


    it was in file called a html file.
    Last edited by pentium5; January 6th, 2002 at 04:55 AM.
    regards,

    wish to use AT 89c51 single chip computer to do remote sensing and send the data back from woods to office via nokie 3330 and internet. HOW?
    first I must revise C program thro' example, what's next?
  2. #2
  3. No Profile Picture
    Just Diggity
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2001
    Location
    Sherman Oaks, CA
    Posts
    126
    Rep Power
    13
    I believe external javascript files must be .js
    Dave Pedowitz
  4. #3
  5. The Basketball Star
    Devshed Novice (500 - 999 posts)

    Join Date
    Aug 2001
    Location
    H-Town
    Posts
    550
    Rep Power
    14
    This is how I've found it to work. Yes, you can call a non-JavaScript file like using the <script> tag, but you have to make certain ajustments. First of all, you can tell it that the language is javascript and then call a PHP file. That just doesn't make much sense. You'd have to just do:
    Code:
    <script src="php_file.php"></script>
    But the catch is in the PHP file, you can print out like normal. You have to print out a Javascript header and use JavaScript commands like document.write() to print out the text. I do this in Perl all the time because there are some cases where I can't use SSI. If you were using perl, I'd give you an actual example, but I don't know what use it would be since you're using PHP.

IMN logo majestic logo threadwatch logo seochat tools logo