Results 1 to 3 of 3
  1. #1
    Grandma broke her coccyx! Uncle Rico's Avatar
    Join Date
    May 8th, 2007
    Location
    North Carolina
    Posts
    2,238
    JavaScript Calling Php Script
    I am trying to make a call to a php file from another file using javascript. I place the following statement on the page I want the php called from.
    Code:
    <script language="JavaScript" src="./crap/testcrap.php"></script>
    Then, in test.php, I do something like this.
    Code:
    echo "document.write("\";
    echo .....my form.....
    echo "\");";
    The form doesn't show on the page at all. It's just blank.

  2. #2
    ABW Ambassador
    Join Date
    January 18th, 2005
    Posts
    1,205
    Do a google search for AJAX. Async Javascript And XMLHttpRequest

    Jquery makes it easy.

    Code:
    $("#div-container-for-form").load("yourfile.php")
    Dr. Strangeweb, or how I learned how to stop worrying about SERPS and love the WOM.

  3. #3
    Grandma broke her coccyx! Uncle Rico's Avatar
    Join Date
    May 8th, 2007
    Location
    North Carolina
    Posts
    2,238
    I figured it out. I need to swap double quotes for single quotes within the document.write call.

  4. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. Speed of Php vs Javascript
    By hovesh07 in forum PopShops
    Replies: 0
    Last Post: April 28th, 2009, 02:11 AM
  2. Javascript has product pages but PHP does not?
    By dmarques1 in forum GoldenCAN
    Replies: 3
    Last Post: December 29th, 2008, 10:08 PM
  3. php vs. javascript
    By profusion in forum GoldenCAN
    Replies: 1
    Last Post: September 16th, 2008, 10:02 AM
  4. Calling .php using Iframe
    By ~Michelle in forum Programming / Datafeeds / Tools
    Replies: 5
    Last Post: April 6th, 2004, 04:12 PM
  5. Calling CGI with Javascript
    By c4 in forum Programming / Datafeeds / Tools
    Replies: 0
    Last Post: April 16th, 2002, 03:16 PM

Posting Permissions

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