www.webdeveloper.com
Results 1 to 5 of 5

Thread: Calling jscript function

Hybrid View

  1. #1
    Join Date
    Apr 2006
    Posts
    12

    Calling jscript function

    1. How i can call a jscript function from PHP?
    2. How i can pass a php variable value to a javascript function?

  2. #2
    Join Date
    Jul 2005
    Posts
    162
    1. How i can call a jscript function from PHP?
    You can't. PHP is server based and Jscript is client-based.
    You can, of course, use event handlers, but they won't execute until the page is entirely built.

    2. How i can pass a php variable value to a javascript function?
    This is possible in the jscript code. I'll give an example.
    HTML Code:
    jsvar = '<?PHP echo $phpvar ?>'
    Note that the other way around is not possible this way.
    I always try to do things in chronological order

  3. #3
    Join Date
    Mar 2005
    Location
    Sydney, Australia
    Posts
    7,974
    To pass information from Javascript to PHP (after the web page has loaded) you can use Ajax.
    Stephen

  4. #4
    Join Date
    May 2006
    Location
    Toronto, Canada
    Posts
    9

    ..

    Yes, and there are also AJAX-PHP frameworks available. Just google Ajax php frameworks
    www.thincmedia.com - Ideas build brands. Brands generate results. Results drive businesses.

  5. #5
    Join Date
    Apr 2006
    Posts
    12
    thank u.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles