# FAQs

## FAQs

**1. It's not working locally:**

If your're using it locally, make sure to use a local server. The frontend(s) will not be displayed, when you just open a .html page in a browser. If you see ...

```markup
file://...
```

... in the browsers address bar, it won't work. Use a local server like XAMPP or start a local server in your working directory on a Mac with ...

```markup
> python -m SimpleHTTPServer 8000
```

Then open your .html like this:

```markup
http://localhost:8000/<yourPage>.html
```

**2. Should I use "onload" or "" events (wait till everything is loaded)?**

Yes! Do it like this:

```markup
var myYumpu; // make a global variable
document.addEventListener("DOMContentLoaded", function(){
   ...
   myYumpu = new Yumpu();
   myYumpu.create_...( ... );
   ...
});
```

**3. Do I have to create multiple Yumpu objects when creating multiple magazines or bookshelfs on my page?**

No! You can create multiple magazines and/or bookshelfs with one Yumpu object.

Correct:

```markup
   myYumpu = new Yumpu();
   myYumpu.create_player( ... );
   myYumpu.create_bookshelf( ... );
   myYumpu.create_player( ... );
   myYumpu.create_bookshelf( ... );
   ...
```

Wrong:

```markup
   myYumpu = new Yumpu();
   myYumpu.create_player( ... );

   myYumpu2 = new Yumpu();
   myYumpu2.create_bookshelf( ... );

   myYumpu3 = new Yumpu();
   myYumpu3.create_player( ... );

   myYumpu4 = new Yumpu();
   myYumpu4.create_bookshelf( ... );
   ...
```

**4. Why should I use the Yumpu Javascript API to create bookshelfs and magazines, rather than embedding  on my page?**

Performance, speed, loading duration, and handling! If using more than one  on your page, you can watch the performance of your page going down. It's getting slow, laggy - just no fun to use, as all the resources get loaded over and over again. With our Javascript API these problems will be avoided. Also, the needed resources only get loaded once - no mather how many bookshelfs or magazines you create. Another thing is, that the bookshelfs and magazines resize themselves automatically within the HTML elements you place them in, which, on the other hand, will be resized by your CMS (or whatever you are using).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.yumpu.com/js/faqs.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
