Answer the question
In order to leave comments, you need to log in
How to enable cross domain requests?
Help with cross-domain requests.
There is a URL - eportal.com.ua/admin.php?start=1&count=10&brand=brand1
I make a GET request
$.ajax({
type: "GET"
url: @.url
beforeSend: ->
$('.content-spinner').show()
complete: ->
$('.content__spinner').hide()
success: (data)=>
@.needfullInfo = $.map(data, (item)->
{
id: item.ID
name: item.NAME
price: item.PRICE
brand: item.BRAND
desc: item.DESCRIPTION
img_url: item.IMG
img2: item.IMG2
weight: item.WEIGHT
volume: item.VOLUME
}
)
@.attachTemplate()
return
error: =>
$('.content__spinner').hide()
errorPage = '../../errorPage.html'
@.container.load(errorPage)
})
XMLHttpRequest cannot load http://eportal.com.ua/admin.php?start=1&count=10&brand=brand1.
No 'Access-Control-Allow-Origin' header is present on the requested resource.
Origin 'http://192.168.0.100:3000' is therefore not allowed access.
Answer the question
In order to leave comments, you need to log in
zinoui.com/blog/cross-domain-ajax-request
https://learn.javascript.ru/xhr-crossdomain
Specify the permission for the domain or all connections on the server in the config.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question