0

Hello , so i get an error with ajax when i move the site i scripted to my server ( so on my localhost it works ) . The error is something like origin not allowed by access control allow origin

var trimitere = $.ajax({
                url: "underpublic/searchforprice.php",
                type: "get",
                crossDomain: true,
                data: coduri + '&callback=?',
                success: function(response) {
                    if(response != ''){
                        $(".loader").hide(500);
                        $("#aratarez").append(response);
                    }else{
                        $("#rezultate").hide(400, function(){
                            alert("fail");
                        }); // end functie hide

                    } // end if-else
                } // end succes

            }); // end ajax

Edited by MWEB

4
Contributors
8
Replies
33
Views
3 Years
Discussion Span
Last Post by MWEB
0

The error is something like origin not allowed by access control allow origin

@MWEB

You need to check whether your path to that file is there.

0

@LastMitch can you be more explicit ? please :D

0

More explicitly www.yourwebsite.com/underpublic/searchforprice.php

What happens if you take the crossDomain: true line out?

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.