Results 1 to 6 of 6

Thread: Ajax script error: POST method not allowed

  1. #1
    Join Date
    Apr 2008
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Exclamation Ajax script error: POST method not allowed

    1) Script Title: Ajax Tabs Content Script (v 2,2)

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...axtabscontent/

    3) Describe problem:

    I love this script, but I'm attempting to use it with a number of PHP calculators, and find that though it works fine in "#IFRAME" mode completely without errors, yet it fails when I try to use my PHP scripts with other modes. Though the other modes of "BASIC" and "DIV" do in fact succeed in calling and writing the PHP calculators as originally called, and each calculator is loaded appropriately and initially funcions within their seperate divs, when I then try to then calculate (the PHP script uses FORM and POST to input and output the results), I get an error, which is:

    "Method Not Allowed
    The requested method POST is not allowed for the URL /calculator/MortgageCalculators1/master-test.htm."

    Is there a work around for this? Again, the PHP calculator scripts uses FORM for the input and POST for the output. Appriciate any help that can be given,

    Thanks,

    Greg

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    I assume you're mainly running into trouble using the "Ajax" mode (versus "IFRAME") to get the contents of the calculator and have it function as expected? A link to the problem page would be helpful.

  3. The Following User Says Thank You to ddadmin For This Useful Post:

    b4greg (04-14-2008)

  4. #3
    Join Date
    Apr 2008
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Yes... the IFRAME mode works fine, but the AJAX mode comes up with the above error.

    Here's a temporary active link which demonstrates full compatability with IFRAME verses the error that I receive in AJAX mode. Please note that in AJAX mode, tabs 1, 2, and 3 call up the PHP caculators correctly, tab 4 calls up the demo external4.htm. The first three tabs will not function beyond being called up correctly. They do not execute the calculation.

    http://www.trustkb.com/calculator/Mo...aster-test.htm

    Thanks again for looking into this.


    Greg
    Last edited by b4greg; 04-15-2008 at 01:34 PM.

  5. #4
    Join Date
    Apr 2008
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

  6. #5
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Looking at the source for one of your PHP calculators (ie: here), I see that it uses JavaScript for certain functions (ie: "calculators.js"). That's most likely the source of the problem. Pages fetched via Ajax will often "lose" the JavaScript included on the page, as Ajax basically cuts and pastes the fetched content onto the page without reinterpreting the JavaScript on it.

    You can try manually adding any external .js and .css files referenced in your PHP calculator pages to the main page containing Ajax Tabs Content script, so they are always available. This may or may not work still, however:

    Code:
    <link href="calculators.css" type="text/css" rel="stylesheet">
    <script type="text/javascript" src="calculators.js"></script>

  7. #6
    Join Date
    Apr 2008
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Thanks very much for your suggestion, but as you guessed, it didn't work.... Ajax has its limitations.... That's another reason for prefering PHP. This script rewritten as an all PHP-function would likely work, but I'm afraid I'm not that skilled. The good news is that the IFRAME Mode works just fine, though it would be great to make use of the further versatility of AJAX. Thanks again for taking the time to look at the problem.

    Greg

Bookmarks

Posting Permissions

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