File tree Expand file tree Collapse file tree 1 file changed +28
-2
lines changed
Expand file tree Collapse file tree 1 file changed +28
-2
lines changed Original file line number Diff line number Diff line change 11
22// 2. The function to render the list
33function 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+ } ) ;
You can’t perform that action at this time.
0 commit comments