L
L
LYTK42020-10-27 12:47:42
JavaScript
LYTK4, 2020-10-27 12:47:42

HTML layout + CSS fonts are not displayed, after reinstalling Windows 10, what should I do?

I am developing a project, I reinstalled Windows, before that everything was ok, after reinstalling the fonts on the page do not work, the code for connecting fonts:

@font-face{
  font-family:Stolzl;
  src: url("1.woff2") format("woff2"), url("1.woff2") format("woff2");
  font-family:Consolas;
  src: url("2.woff2") format("woff2"), url("2.woff2") format("woff2");
}

In class:
.FooterText1 {
  font-family:Stolzl;
  font-size: 35px;
  color:#00ff9c;
}

Answer the question

In order to leave comments, you need to log in

3 answer(s)
C
curator, 2016-04-30
@crazy_str

Use Promises.
https://learn.javascript.ru/promise
caniuse.com/#feat=promises
https://github.com/dfilatov/vow , etc.
Or jQuery.Deferred :

function getLang(lang) {
    var d = $.Deferred();

    $.getJSON(gInit['url'] + '/lang/'+getCookie('lang')+'.json', function(data) {
        var items = [];
        $.each(data, function(key, val) {
            if(key == lang) {
                items.push(val);
            }
        });
        d.resolve(items);
    });
 
    return d.promise();
}

var test = getLang("users");
test.done(function (data) {
     console.log(data);
});

A
Alexey, 2016-04-30
@alsopub

The problem is that you don't fully understand how callback functions and asynchronous calls work.
When calling getLang("users") from the console, no return is triggered at all. The $.getJSON function is called and that's it, the getLang function completes its work.
In parallel with this, the request gInit['url'] + '/lang/'+getCookie('lang')+'.json' is executed (it can be executed, for example, for several seconds) and upon completion your code is executed, up to return , however, there is no one to return the value to.
Replace return with alert or console.log and you will understand everything yourself.

T
tim_hilfiger, 2020-10-27
@tim_hilfiger

I myself mave recently such a problem. In order for everything to work, it is necessary to write in css those that you have already written in html, write a link to google fonts and children there, taking your fonts. There, on the site, take the fonts, firstly, a link to html, and then a link to css. That's it)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question