Skip to content

Commit a317488

Browse files
added ui,ad and other area js files
1 parent 1038df4 commit a317488

File tree

1 file changed

+28
-2
lines changed

1 file changed

+28
-2
lines changed

1991/javascripts/ui.js

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,27 @@
11

22
// 2. The function to render the list
33
function renderPlaylist() {
4+
5+
6+
7+
// 1. Get the query string (e.g., "?product=vanilla&id=42")
8+
const queryString = window.location.search;
9+
10+
// 2. Create the URLSearchParams object
11+
const urlParams = new URLSearchParams(queryString);
12+
13+
// 3. Get specific values
14+
const title = urlParams.get('title');
15+
const topic = urlParams.get('topic');
16+
const country = urlParams.get('cn');
17+
18+
if(title){
19+
$('#title').text(title);
20+
}
21+
22+
23+
24+
425
const container = document.getElementById('list-wrapper');
526

627
// Clear existing content (optional)
@@ -44,5 +65,10 @@ function renderPlaylist() {
4465
});
4566
}
4667

47-
// Run the function
48-
document.addEventListener('DOMContentLoaded', renderPlaylist);
68+
$(function(){
69+
70+
// Run the function
71+
document.addEventListener('DOMContentLoaded', renderPlaylist);
72+
73+
74+
});

0 commit comments

Comments
 (0)