jquery - How to make ajax request across sub-domain of the same website -
please need here! working jquery, ajax , php, wrote function (php_folder) this.
function php_folder(evt){ return "www.mywebsite.com/path/to/php/files/";} the purpose enable me call function + php file during ajax request. this:
$.ajax({ url:php_folder+'script.php',}); this works when current url http://www.mywebsite.com. not work when logged on http://mywebsite.com (without www.)
this error on error console:
xmlhttprequest cannot load
http://www.mywebsite.com/script.php. originhttp://mywebsite.comnot allowed access-control-allow-origin.
please how can fix this??
instead of hardcoded url can read window.location , dynamically change value of domain.
Comments
Post a Comment