2
I made a function jQuery and in the URL passage he is not finding the file. I found it strange he does not find, because the file exists.
Every call I have within the site, is always the same, be it src
or href
, the call is the same, so:
../../pasta_base/pasta_secundária/nome_do_arquivo.asp
To give an example in my case, I do so:
../../prs/asp/prs0061b_crossbrowser.asp
.
This way works and I can find the file. That’s how it is all over the site. However, when I call by jQuery, returns me error 404, page not found.
I don’t know if it has anything to do with being in a jQuery role. Since we are rewriting the site to work on Chrome, there is no jQuery function the way I did, this is the first. See how my job is:
function CarregaTabela() {
var str = "";
$.ajax({
url: '../../prs/asp/prs0061b_crossbrowser.asp',//aqui não acha nada
datatype: 'json',
contentType: 'application/json; charset=utf-8',
type: 'POST',
data: JSON.stringify({}),
success: function (data) {
//$(data.resultado_acao).each(function () {
})
},
error: function (error) {
}
})
}
I would just like to know, if what I did is correct, if it is this way. I do so with MVC, but there in the URL I put action/controller
, now with direct file do not know if it is correct. It is classic ASP.
So, but look at my situation. Today I have a testing environment that is different from the publishing environment. In addition to my environment, there is the homol environment. If I manually type my path, it will get zebra if it is published in another environment. The form .. /.. /, it takes the base environment and then only complete with the appropriate folders and file name.
– pnet
You are not manually typing. When you place a URL as the basis of everything you define the basis of the site. Let’s assume, http://www.dominio.com.br/admin. Then in JS you have to enter the folder products inside images. So do it like this:
baseURL + '/imagens/produtos'
. If you didn’t have the foundation you’d have to use the../../
to return to the base, because you are inside the folderjs
perhaps because of the current file. But if in your production environment you have a folderpublic
already breaks two legs. But using the base URL no. Since thehtaccess
controls access topublic
.– Diego Souza