Results 1 to 4 of 4

Thread: XMLHttpRequest gets 404 — why??

  1. #1
    User
    Join Date
    04-05-10.
    Location
    Ukraine, Kiev
    Posts
    47

    Default XMLHttpRequest gets 404 — why??

    I see something whired...
    Contao 2.9.1
    When I try to load a page via ajax requests — I get 404 error!
    If to load the same page by pasting it into browser address bar — everything is good.
    Why? And how to get content via ajax? Is this something new in 2.9.1?

    Web inspector's log:
    Code:
    Request URL:http://ru.agro.terion.name/productio...pshenicja.html
    Request Method:GET
    Status Code:404 Not Found
    
    Request Headers
    Accept:text/html, */*
    Referer:http://ru.agro.terion.name/production.html
    User-Agent:Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.7 (KHTML, like Gecko) Chrome/7.0.517.44 Safari/534.7
    X-Requested-With:XMLHttpRequest
    
    Response Headers
    Cache-Control:no-cache, pre-check=0, post-check=0
    Connection:keep-alive
    Content-Encoding:gzip
    Content-Type:text/html; charset=UTF-8
    Date:Tue, 16 Nov 2010 12:58:39 GMT
    Expires:Wed, 28 Jan 1976 11:52:00 GMT
    Last-Modified:Tue, 16 Nov 2010 12:58:39 GMT
    Pragma:no-cache
    Server:nginx/0.7.67
    Transfer-Encoding:chunked
    Vary:Accept-Encoding
    X-Powered-By:PHP/5.3.3
    I forge my wisdom
    Into an arc surrounding all.
    I forge my heartbeat
    To a dome all heavens wide

  2. #2
    User taca's Avatar
    Join Date
    06-20-09.
    Location
    Kyoto, Japan
    Posts
    111

    Default Re: XMLHttpRequest gets 404 — why??

    Hi,

    Quote Originally Posted by Terion
    I see something whired...
    Contao 2.9.1
    When I try to load a page via ajax requests — I get 404 error!
    If to load the same page by pasting it into browser address bar — everything is good.
    Why? And how to get content via ajax? Is this something new in 2.9.1?
    When I looked at the URL, it shows something but HTTP respose is really "404".
    Have you check HTTP response when you see the page?
    (I checked with Live HTTP headers extention of Firefox.)

    The page is realy 404 type of page?

    Best regards.
    --
    Takahiro Kambe

  3. #3
    User
    Join Date
    04-05-10.
    Location
    Ukraine, Kiev
    Posts
    47

    Default Re: XMLHttpRequest gets 404 — why??

    Ohhh!!! Why I didn't look at headers in the beginning...
    Shame on me.
    There is a catalog reader module on the same page that sends 404-headers if nothing found...
    Thanx alot
    I forge my wisdom
    Into an arc surrounding all.
    I forge my heartbeat
    To a dome all heavens wide

  4. #4
    Experienced user
    Join Date
    06-10-09.
    Location
    Cape Town, South Africa
    Posts
    1,387

    Default Re: XMLHttpRequest gets 404 — why??

    Just install Andreas' ajax.php helper from the E.R.

    You can then call any Contao Module like this:
    ajax.php?action=fmd&id=3

    You can try it on my website (this will load the footer into a browser) -- the g=1 parameter means to use the standard generate function of the module (you can also write a special generateAjax() function will will be called instead of you leave that off...
    http://www.mojaheritage.co.za/ajax.php? ... d&id=2&g=1

    This makes it really easy to make special modules with alternative templates for use only in ajax, or using the current one, but replacing the HTML with the new content.

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
  •