How to use javascript in php?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Randy Webb

    #16
    Re: How to use javascript in php?

    Thomas 'PointedEars' Lahn wrote:[color=blue]
    > Shang Wenbin wrote:
    >
    >[color=green]
    >>How to use javascript in php?[/color]
    >
    >
    > Depends. Client-side JS or server-side JS? Client-side or server-side PHP?[/color]

    I have asked in the past, and you ignored it. Can you give an example of
    Client-Side PHP?
    Even the PHP site says it is a server side language.......

    --
    Randy
    comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly

    Comment

    • Dietmar Meier

      #17
      Re: How to use javascript in php?

      Randy Webb wrote:
      [color=blue]
      > Can you give an example of Client-Side PHP?[/color]

      Great fun: http://www.sitepoint.com/blog-post-view.php?id=181248

      ciao, dhgm (who likes to use Perl for MSIE scripting sometimes)

      Comment

      • @sh

        #18
        Re: How to use javascript in php?

        Its 'do right' pricks like you that scare those genuinely in need of help
        away.

        ....and yes I'm top posting ;o) cause I know it'll irritate you.

        Ash


        "Thomas 'PointedEars' Lahn" <PointedEars@we b.de> wrote in message
        news:1300524.c1 WfziPkzv@Pointe dEars.de...[color=blue]
        > clarket@eircom. net wrote:
        >[color=green]
        >> You need to embed the he javascript into your php.[/color]
        >
        > No, he does not. It is one way, but it is not the only one.
        >[color=green]
        >> e.g.[/color]
        >
        > Very much "e.g.", indeed.
        >[color=green]
        >> echo "<html><body><h ead>";
        >> echo "<script LANGUAGE=\"Java Script1.4\" type=\"text/javascript\"">;
        >> echo "function sayHello(){";
        >> echo "alert(\"hello\ ");";
        >> echo "</script></head></body></html>";[/color]
        >
        > Do you have even a single clue about the languages you are using?
        >
        > 1. The above is as inefficient in PHP as it can be. PHP is the
        > PHP Hypertext *Preprocessor*. What is not within `<?php ... ?>'
        > (or `<? ... ?>' with short_open_tag= on) is not parsed by PHP
        > but simply thrown to stdout, i.e. raw data to be transferred to
        > the client by the Web server if used in a CGI environment.
        >
        > 2. The above will not generate Valid HTML, since
        > - the DOCTYPE declaration is missing
        > - the `body' element must not contain the `head' element
        > - the `title' element is missing.
        >
        > see <http://validator.w3.or g/>.
        > This will force the User Agent to use Quirks Mode, if available,
        > and so produce unreliable results.
        >
        > 3. The `language' attribute is deprecated in HTML 4 and XHTML 1, and
        > the attribute value you are using is, at the most, not fitted for
        > the task.
        >
        > Correction
        > -----------
        >
        > Optionally before:
        >
        > <?php
        > ...
        > ?>
        >
        > Mandatory regarding the task:
        >
        > <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
        > "http://www.w3.org/TR/strict.dtd">
        > <html>
        > <head>
        > <title>JavaScri pt in a PHP script</title>
        >
        > <script type="text/javascript">
        > function sayHello()
        > {
        > alert("hello");
        > }
        > </script>
        > </head>
        >
        > <body>
        > ...
        > </body>
        > </html>
        >
        > Optionally after:
        >
        > <?php
        > ...
        > ?>
        >
        >
        > PointedEars[/color]


        Comment

        • @sh

          #19
          Re: How to use javascript in php?

          Sorry to Thomas PointedEars Lahn as I note I've responded to the wrong area
          of the thread, my response was actually aimed at Randy Webb.


          Comment

          • Randy Webb

            #20
            Re: How to use javascript in php?

            @sh wrote:[color=blue]
            > Sorry to Thomas PointedEars Lahn as I note I've responded to the wrong area
            > of the thread, my response was actually aimed at Randy Webb.[/color]

            So, let's get this straight.

            1) You are too stupid to reply to the proper post.
            2) It only took you almost a month to come up with that reply.
            3) When correcting yourself you were too stupid to quote what you were
            babbling about.
            4) If you weren't so stupid, you would be funny.

            Got it. Your move stupid.

            --
            Randy
            comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly

            Comment

            • @sh

              #21
              Re: How to use javascript in php?

              > 1) You are too stupid to reply to the proper post.

              I didn't feel your branch deserved to be extended
              [color=blue]
              > 2) It only took you almost a month to come up with that reply.[/color]

              Ohhhh dreadfully sorry, been on holiday in Sharm (Egypt) for the past 4
              weeks, your pathetic 'babbling' I'm sure could wait.
              [color=blue]
              > 3) When correcting yourself you were too stupid to quote what you ere
              > babbling about.[/color]

              Your jibberings need not be quoted.
              [color=blue]
              > 4) If you weren't so stupid, you would be funny.[/color]

              Ahhhh, like your name? Sounds more like a cheap porn site!
              [color=blue]
              > Got it. Your move stupid.[/color]

              ....Thanks, hmmmm, no comment, you've just proven my point.

              Cheers, @sh


              Comment

              Working...