ratiw / vuetable-2-tutorial

MIT License
258 stars 67 forks source link

lesson 01 problems #41

Open itelmenko opened 7 years ago

itelmenko commented 7 years ago

Hello!

I have error

XMLHttpRequest cannot load http://vuetable.ratiw.net/api/users?sort=&page=1&per_page=10. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://vuetable.example.test' is therefore not allowed access.

How can I fix it?

One more question. Why we need jquery in this lesson?

ratiw commented 7 years ago

@itelmenko Sorry, the lesson hasn't been updated to Vuetable v1.6 yet. The reference to the sample API endpoint should be done via "https:" instead of just "http:". So, if you change the api-url to as follow it should work.

  <vuetable ref="vuetable"
    api-url="https://vuetable.ratiw.net/api/users"
  ></vuetable>

jQuery is needed for Semantic UI framework that uses in this tutorial.

itelmenko commented 7 years ago

Thank you for you answer. But look like it is cross domain issue (it is for https also):

XMLHttpRequest cannot load https://vuetable.ratiw.net/api/users?sort=&page=1&per_page=10. Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://vuetable.example.test' is therefore not allowed access.