micc83 / fontIconPicker

🌈 jQuery fontIconPicker v2 is a small (3.22kb gzipped) jQuery plugin which allows you to include a simple icon picker with search and pagination inside your administration forms.
http://micc83.github.io/fontIconPicker/
MIT License
266 stars 87 forks source link

Load JSON Icomoon (example 9) #28

Closed Bobolions closed 6 years ago

Bobolions commented 8 years ago

Hi,

I try to reproduce Example 9 of the website. In my code I link to the JSON file on your website to test it.

This is the part of the code where I link to the JSON file:

// Get the JSON file
        $.ajax({
            url: "http://codeb.it/fonticonpicker/icomoon/selection.json",
            type: 'GET',
            dataType: 'json'
        })
        .done(function(response) {

Everything else in the code of example 9 is the same. jQuery is loaded off course. The button also changes to the error text.

Do you know why the icons are not loaded on the click of the button?

Regards

swashata commented 8 years ago

If you are calling this script from any other URL than http://codeb.it then it will not work. That is because cross browser XHR is not possible without setting some headers within the responding server. Host the same file in your server and it should work.