Web Analytics Made Easy -
StatCounter In JavaScript can I use Php - CodingForum

Announcement

Collapse
No announcement yet.

In JavaScript can I use Php

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • In JavaScript can I use Php

    Hi
    I need Help can I use Java Script in php orrr php in javascript.
    http://www.goodclassified.com/
    Please Reply Soon Example

  • #2
    Not sure what you mean by "use".

    You just echo/print the javascript like you would do with html, like:
    Code:
    <? 
    echo "<script type='text/JavaScript'>\n"; 
    echo "alert('Javascript from php');\n"; 
    echo "</script>"; 
    ?>
    Suggest you Google for more information on how php and Javascript can (and cannot) interact.
    Example:-


    It is your responsibility to die() if necessary….. - PHP Manual
    Last edited by Philip M; Aug 17, 2011, 04:10 PM.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

    Comment

    Working...
    X
    😀
    🥰
    🤢
    😎
    😡
    👍
    👎