| 0 |
{{QueryCarousel('subject:("Artificial Intelligence" AND "Nonfiction") first_publish_year:[2000 TO *]', title="Books on Artificial Intelligence", key="ai")}} |
0 |
{{QueryCarousel('subject:("Artificial Intelligence" AND "Nonfiction") first_publish_year:[2000 TO *]', title="Books on Artificial Intelligence", key="ai")}} |
| ... |
|
... |
|
| 5 |
|
5 |
|
| 6 |
<div class="carousel"> |
6 |
Promise.all(promises).then(() => { |
| 7 |
<div class="carousel-item" data-id="OL42321031W"></div> |
7 |
// Adding the predefined IDs to the carousel |
| 8 |
<div class="carousel-item" data-id="OL42320898W"></div> |
8 |
urls.push("OL42321031W", "OL42320898W", "OL42341553W"); |
| 9 |
<div class="carousel-item" data-id="OL42341553W"></div> |
9 |
|
| 10 |
</div> |
10 |
// Optionally, logging the result for testing |
|
|
11 |
console.log("Final list of URLs:", urls); |
|
|
12 |
|
|
|
13 |
// Example of what you could do with the URLs |
|
|
14 |
document.querySelectorAll('.carousel-item').forEach((item, index) => { |
|
|
15 |
item.setAttribute('data-id', urls[index]); |
|
|
16 |
}); |
|