Return error in AJAX

Asked

Viewed 138 times

1

I’m having a return problem in Ajax, I have a button that returns html data by AJAX, when I use the home page (home) or categories in this template http://www.site.com/diretorio request data returns correctly when prompted by the button that calls AJAX but when I am at addresses like this http://www.site.com/diretorio/subdiretorio/subdiretorio2, The request by Ajax is performed but returns the html of the home site. The request goes on the page to go with the data but the return response is not the html with the data but the home html and only happens when I am at this address making the request , in the other two structure addresses works perfectly. I’m waiting for help

  • I believe you’re using a relative URL, from what you described. Have you looked at the browser developer tools to make sure the AJAX request is correct?

  • Since you did not post the Javascript code, I will recommend that you use the full URL when informing you during the request, for example: /recebe_dados.php or //www.site.com/recebe_dados.php

  • I already used full URL in Ajax and nothing , Ajax returns Error only in this URL mode http://www.site.com/directory/subdirectory there is some tool to observe this return because when I am in this url mode the Ajax returns to the home of the site and not the data worked in receiving data.php

  • @Casima Press F12 and navigate to the tab Network to check the requests.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.