I have a piece of javascript that can be executed from several pages with different URLs. Code is working properly in this case (here is the key URL parameter, nothing else will change):
$. Val (PageName);}, Error: Function (page name = "+ $") (Ajax ({type: "POST", url: "./( {page name} {$ (" # updated page name " ("# PageToEdit"). Val (), success: function Req, error) {if (error === 'error') {error = req.statusText;} alert ("was an error:" + error);} }); When I try to modify the url parameter to do something like this:
$. Ajax ({type: "Error" (error === 'error') {error = req.statusText;} Warning ("One error", "POST", url: BASE_URL + "ajax (page name =) + $ (" # page tutorial ", error) Procedure was: "+ error);}}); Where BASE_URL is stationary, it causes an error It seems that the request is not being sent (when I'm trying to do so, there are no 404 errors in the console in Firebug ) And just say "error" in the error message.
The first thing that works, when this happens to be on a page, the URL parameter that is understood to be. Why is any thoughts happening and what can be the solution for this?
Thanks in advance.
I have solved this issue due to the problem being added to the domain name at BASE_URL The BASE_URL variable should be "http://www.mydomain.com/base/url/" once I left "http://www.mydomain.com" then it worked. My BASE_URL became "/ base / url /".
Comments
Post a Comment