File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -3,6 +3,9 @@ import { type ServerLoad } from '@sveltejs/kit';
33export const prerender = false ;
44
55export const load : ServerLoad = async ( { fetch } ) => {
6- const res = await fetch ( 'http://localhost:8080/widgets.php?file=files/test1.json' ) ;
7- return { widgetResponse : await res . text ( ) } ;
6+ const FILE_PATH = 'files/test1.json' ;
7+ const widgetHTML = await ( await fetch ( `http://localhost:8080/widgets.php?file=${ FILE_PATH } ` ) ) . text ( ) ;
8+ const tableHTML = await ( await fetch ( 'http://localhost:8080/tables.php/?file=files/test1.json' ) ) . text ( ) ;
9+ const tabbedInfoHTML = await ( await fetch ( 'http://localhost:8080/tabbed_info.php/?file=files/test1.json' ) ) . text ( ) ;
10+ return { widgetHTML, tableHTML, tabbedInfoHTML} ;
811} ;
Original file line number Diff line number Diff line change 77 onMount (() => {
88 // console.log(data.widgetResponse);
99 const wrapperDiv = document .getElementById (' legacy-content' );
10- wrapperDiv ! .innerHTML = data .widgetResponse ;
10+ wrapperDiv ! .innerHTML = data .widgetHTML + data . tabbedInfoHTML + data . tableHTML ;
1111 // document.appendChild(wrapperDiv);
1212 });
1313 </script >
You can’t perform that action at this time.
0 commit comments