Results 1 to 1 of 1

Thread: pass data/variable from php to jscript

  1. #1
    Join Date
    Aug 2009
    Posts
    59

    pass data/variable from php to jscript

    Hello,

    So, I have a javascript page which I need to send data to an external php page(probably through an XMLHttpRequest). The php script will connect to a SQL database and retrieve data (comments, username, and date) in array form.

    The problem is I need to pass that array to the javascript function that called it.

    The javascript page is a completely separate file from the php page.

    I had searched around and some people suggested that in the php page, I "echo" out the data as XML. I looked this up and it's all a lot of new stuff that I gotta learn, but first I wanted to know if I'm on the right path and if not is there another way to do it?

    BTW the page that is running the js script will not be reloaded, it's using AJAX to call and not refresh the entire page.
    Last edited by darkray16; 27 Jul 2010 at 03:11 AM.

Posting Permissions

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