1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Ajax with friendly urls

Discussion in 'XenForo Development Discussions' started by infis, Jun 3, 2014.

  1. infis

    infis Well-Known Member

    return 404 error, but
    return correct response?
  2. Chris D

    Chris D XenForo Developer Staff Member

  3. Chris D

    Chris D XenForo Developer Staff Member

  4. infis

    infis Well-Known Member

    Hm. Thanks!
    Class "Autocomplete" add path as index.php?members/find&_xfResponseType=json. And on forums with enabled friendly urls it's path is some. That is not true or correct?
  5. Chris D

    Chris D XenForo Developer Staff Member

    The index.php version of URLs remains working, even with friendly URLs enabled:


    And when the unfriendly URL is hidden away in some AJAX request somewhere, the friendly URL is pretty irrelevant. The default AutoComplete URL is an unfriendly URL because it's hard coded in the javascript, and its done that way because the javascript has no access to a link building class or any concept of the XenForo options to determine if the friendly URLs are working or not.

    You can pass any URL you like, friendly or unfriendly to the JS as a data-acurl attribute assigned on the input element.
  6. infis

    infis Well-Known Member

    I know that I can set any URL. I was interested in only the extent properly when the friendly URL for use AJAX links with index.php. It turns out that this is not a bug, but a feature. Well so be it. Although I do not seem right.
  7. Chris D

    Chris D XenForo Developer Staff Member

    Of course it is right.

    How is it wrong?

    It's a hard coded URL in the JS code to ensure full compatibility regardless of URL configuration.

    I don't see how else it could be done.
    infis likes this.
  8. infis

    infis Well-Known Member

    Ok. Of course, we can pass a variable to the script base URL. But we can use and not user-friendly URL.
    Thanks for the help!

Share This Page