Preberite datoteko JSON z uporabo JavaScripta

Preberite datoteko JSON z uporabo JavaScripta

JSON pomeni Zapis predmeta JavaScript . To je način organiziranja podatkov v skriptni datoteki z uporabo besedila, kar olajša shranjevanje in skupno rabo podatkov.

Branje JSON datoteke, ne glede na to, ali so shranjene lokalno ali na strežniku, je ključnega pomena za spletne aplikacije. V tej vadnici bomo obravnavali tri metode za branje datotek JSON v JavaScriptu, kar je lahko zelo koristno za spletne razvijalce.

Kazalo

OPOMBA: JavaScript interno podpira JSON, tako da ne potrebuje dodatnih modulov za uvoz in prikaz JSON. Samo uvoziti moramo datoteko JSON in jo lahko preprosto uporabimo neposredno za izvajanje manipulacij z njo.

Kako prebrati datoteko JSON v JavaScriptu?

Trije načini branja datotek JSON v JavaScriptu so:

Opomba: Za pridobivanje podatkov bo uporabljena spodnja datoteka JSON.

sample.json

{ 'users':[ { 'site':'techcodeview.com', 'user': 'Shobhit' } ] } 

1. Uporaba API-ja fetch() za branje datoteke JSON

Metoda fetch() se uporablja za branje datotek JSON (lokalnih ali naloženih datotek). Za obe vrsti datotek uporablja isto sintakso.

Sintaksa

fetch('JSONFilePath').then().then().catch(); 

Sledite tem korakom za branje datoteke JSON z metodo API-ja pridobivanja:

  • Ustvarite datoteko JSON in ji dodajte podatke
  • Odprite datoteko JavaScript
  • V metodi pridobivanja posredujte pot do datoteke JSON
  • Za razčlenitev podatkov v formatu JSON uporabite metodo .json().
  • Prikažite vsebino v konzoli.

Primer branja datoteke JSON v JavaScriptu:

Spodnja koda vam bo pomagala razumeti uporabo metode fetch() za branje datotek JSON.

HTML
          Preberite JSON Filetitle> head> <body>  <h1>techcodeview.comh1> <h3>Pojdite na konzolo in si oglejte pridobljene podatke!! h3> <script>funkcija fetchJSONData() { fetch('./sample.json') .then((res) => { if (!res.ok) { vrzi novo napako (`Napaka HTTP! Status: ${res.status} `); } return res.json(); .then((data) => console.log(data)) .catch((error) => console.error('Unable to get data:', napaka));  } pridobi podatkeJSON();  skript> telo> html> </pre>  </code>  <p dir='ltr'>  <b>  <strong>Izhod: </strong>  </b>  </p>  <p dir='ltr'> <img src='//techcodeview.com/img/javascript-questions/49/read-json-file-using-javascript.webp' alt='konzolni pogled podatkov JSON po pridobivanju API-ja'> </p>  <h2 id='using-the-require-module-to-read-json-file'>  <b>  <strong>2. Uporaba modula Require za branje datoteke JSON </strong>  </b>  </h2> <p dir='ltr'>  <span>Zahtevaj modul </span>  <span>se uporablja za vključitev modulov v vašo aplikacijo. Uporablja se lahko za vključitev datoteke v spletno aplikacijo. </span> </p>  <h3> <span>Sintaksa: </span> </h3> <pre>require(JSONFilePath); </pre> <p dir='ltr'> <span>Sledite tem korakom za branje datotek JSON z zahtevanim modulom v JavaScriptu. </span> </p>  <ul> <li value='1'> <span>Ustvarite datoteko JSON, kot je navedeno v prejšnjem pristopu </span> </li> <li value='2'> <span>Ustvarite script.js in uporabite zahtevano metodo vozlišča za uvoz datoteke JSON </span> </li> <li value='3'> <span>Natisnite podatke na konzoli </span> </li> </ul> <p dir='ltr'>  <b>  <strong>OPOMBA: </strong>  </b>  <span>Namesto da bi program zagnali v brskalniku, ga bomo zagnali na konzoli z uporabo Node. Prepričajte se, da imate vsaj različico Node 17.0. </span> </p>  <h3>  <b>  <strong>Primer </strong>  </b>  </h3> <p dir='ltr'> <span>Spodnjo kodo lahko neposredno prilepite v skriptno datoteko (vozlišče mora biti nameščeno), da se izvedejo in pridobijo podatki JSON. </span> </p>Javascript <code>  <pre>const sample = require('./sample.json'); console.log(sample); </pre>  </code>  <p dir='ltr'>  <b>  <strong>Izhod: </strong>  </b>  </p>  <pre>{ users: [ { site: 'GeeksForGeeks', user: 'Shobhit' } ] } </pre> <h2 id='by-importing-the-module-to-read-json-file'>  <b>  <strong>3. Z uvozom modula za branje datoteke JSON </strong>  </b>  </h2> <p dir='ltr'> <span>The </span>  <span>uvozna izjava </span>  <span>se lahko uporablja za uvoz in shranjevanje elementov datoteke JSON v spremenljivko v JavaScriptu. </span> </p>  <h3> <span>Sintaksa: </span> </h3> <pre>import nameOfVariable from 'JSONFilePath' assert {type: 'json'}; </pre> <ul> <li value='1'> <span>Ustvarite datoteko JSON, kot je opisano v prejšnjih primerih. </span> </li> <li value='2'> <span>Ustvarite datoteko script.js in uvozite datoteko JSON </span> </li> </ul> <h3>  <b>  <strong>Primer branja datoteke JSON v JavaScriptu: </strong>  </b>  </h3> <p dir='ltr'> <span>Spodnja koda Prebere datoteko JSON tako, da jo uvozi s stavkom import. </span> </p>HTML <code>  <pre>   <html lang='en'>  <head>  <meta charset='UTF-8'>  <meta name='viewport' content= 'width=device-width, initial-scale=1.0'>  <title>Preberite JSON Filetitle> head> <body>  <h1>techcodeview.comh1> <h3>Pojdite na konzolo in si oglejte pridobljene podatke!! h3> <script type='module' src='./script.js'>skript> telo> html> </pre>  </code>Javascript <code>  <pre>// script.js import user from './sample.json' assert { type: 'json' }; console.log(user) </pre>  </code>  <p dir='ltr'>  <b>  <strong>Izhod: </strong>  </b>  </p>  <p dir='ltr'> <img src='//techcodeview.com/img/javascript-questions/49/read-json-file-using-javascript.webp' alt='konzolni pogled podatkov JSON z uporabo uvoznega modula'> </p>  <h2 id='conclusion'> <span>Zaključek </span> </h2> <p dir='ltr'> <span>Branje datotek JSON v JavaScriptu je zelo pomembna naloga za spletnega razvijalca, saj se datoteke JSON uporabljajo za shranjevanje uporabniških podatkov, konfiguracijskih podatkov, statičnih podatkov in drugih pomembnih informacij. </span> </p>  <p dir='ltr'> <span>V tem priročniku so s primeri razloženi trije načini branja datotek JSON v JavaScriptu. Z razumevanjem teh tehnik se lahko razvijalci samozavestno lotijo ​​nalog, povezanih z datotekami JSON, s čimer zagotovijo bolj gladke razvojne procese in izboljšano uporabniško izkušnjo. </span> </p>  <br>  <br>
                     </div>

                     <!-- Article Footer with Prominent Share Buttons -->
                     <div class="px-6 md:px-8 py-8 bg-slate-50 dark:bg-slate-900/50 border-t border-slate-200 dark:border-slate-700/50">
                          <div class="flex flex-col sm:flex-row items-center justify-between gap-6">
                              <h4 class="text-base font-bold text-slate-700 dark:text-slate-300 uppercase tracking-wide flex items-center gap-2">
                                 <i class="fa fa-share-alt text-tech-500"> </i>
                                Deli                              </h4>
                             
                              <div class="flex flex-wrap justify-center gap-3">
                                 <!-- Twitter -->
                                 <a href="https://twitter.com/intent/tweet?text=Preberite datoteko JSON z uporabo JavaScripta&url=https://www.techcodeview.com/sl/read-json-file-using-javascript" 
                                   target="_blank" rel="noopener noreferrer" 
                                   class="flex items-center gap-2 px-6 py-3 rounded-xl bg-[#1DA1F2]/10 text-[#1DA1F2] hover:bg-[#1DA1F2] hover:text-white transition-all duration-300 font-bold text-sm">
                                     <i class="fa fa-twitter text-lg"> </i>
                                     <span class="hidden sm:inline">Twitter </span>
                                 </a>

                                 <!-- Facebook -->
                                 <a href="https://www.facebook.com/sharer/sharer.php?u=https://www.techcodeview.com/sl/read-json-file-using-javascript" 
                                   target="_blank" rel="noopener noreferrer"
                                   class="flex items-center gap-2 px-6 py-3 rounded-xl bg-[#4267B2]/10 text-[#4267B2] hover:bg-[#4267B2] hover:text-white transition-all duration-300 font-bold text-sm">
                                     <i class="fa fa-facebook text-lg"> </i>
                                     <span class="hidden sm:inline">Facebook </span>
                                 </a>
                                
                                 <!-- LinkedIn -->
                                 <a href="https://www.linkedin.com/shareArticle?mini=true&url=https://www.techcodeview.com/sl/read-json-file-using-javascript&title=Preberite datoteko JSON z uporabo JavaScripta" 
                                   target="_blank" rel="noopener noreferrer"
                                   class="flex items-center gap-2 px-6 py-3 rounded-xl bg-[#0077b5]/10 text-[#0077b5] hover:bg-[#0077b5] hover:text-white transition-all duration-300 font-bold text-sm">
                                     <i class="fa fa-linkedin text-lg"> </i>
                                     <span class="hidden sm:inline">LinkedIn </span>
                                 </a>
                              </div>
                          </div>
                     </div>
                </article>

                <!-- Comments Placeholder / Random Articles -->
                <div class="mt-8 bg-white dark:bg-slate-800 border border-slate-200 dark:border-slate-700 rounded-xl p-6 md:p-8 shadow-sm">
                     <h3 class="text-xl font-bold text-slate-900 dark:text-white mb-6 uppercase tracking-wide border-b border-slate-200 dark:border-slate-700 pb-2">
                        Morda Vam Bo Všeč                     </h3>
                     <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                         <div class="group">
                              <a href="/sl/python-sqlalchemy-func" class="block aspect-video rounded-lg overflow-hidden bg-slate-200 dark:bg-slate-700 mb-3">
                                 <img loading="lazy" src="https://techcodeview.com/img/picked/68/python-sqlalchemy-func.webp" onerror="this.onerror=null; this.src='https://techcodeview.com/template/assets/images/unnamed.webp'" alt="Python SQLAlchemy – func.count s filtrom" class="w-full h-full object-cover group-hover:scale-105 transition-transform duration-500">
                              </a>
                              <h4 class="font-bold text-slate-900 dark:text-white leading-tight group-hover:text-tech-500 transition-colors">
                                 <a href="/sl/python-sqlalchemy-func">Python SQLAlchemy – func.count s filtrom </a>
                              </h4>
                         </div> <div class="group">
                              <a href="/sl/java-data-types" class="block aspect-video rounded-lg overflow-hidden bg-slate-200 dark:bg-slate-700 mb-3">
                                 <img loading="lazy" src="https://techcodeview.com/img/java-basics/03/java-data-types.webp" onerror="this.onerror=null; this.src='https://techcodeview.com/template/assets/images/unnamed.webp'" alt="Podatkovni tipi Java" class="w-full h-full object-cover group-hover:scale-105 transition-transform duration-500">
                              </a>
                              <h4 class="font-bold text-slate-900 dark:text-white leading-tight group-hover:text-tech-500 transition-colors">
                                 <a href="/sl/java-data-types">Podatkovni tipi Java </a>
                              </h4>
                         </div>
                     </div>
                </div>
             </div>

             <!-- SECONDARY COLUMN (SIDEBAR) -->
             <!-- Aside Column -->
 <div class="lg:col-span-4 space-y-8">
	
	 <!-- Best Articles Widget -->
	 <div class="rounded-xl bg-white dark:bg-slate-800 border border-slate-200 dark:border-slate-700 p-6 shadow-sm">
		 <div class="mb-4 border-b border-slate-100 dark:border-slate-700 pb-2">
			 <h2 class="text-lg font-bold text-slate-900 dark:text-white uppercase tracking-wide flex items-center">
                 <span class="mr-2 h-2 w-2 rounded-full bg-tech-500"> </span>
                Top Članki             </h2>
		 </div>
		
		 <!-- Owl Carousel Preserved Container -->
		 <div id="owl-carousel-3" class="owl-carousel owl-theme center-owl-nav">
			 <!-- ARTICLE -->
			 <article class="flex items-start gap-4 p-2 hover:bg-slate-50 dark:hover:bg-slate-700/50 rounded-lg transition-colors">
				 <div class="w-20 h-20 shrink-0 overflow-hidden rounded-md bg-slate-200 dark:bg-slate-700">
					 <a href="/sl/roman-to-integer-conversion">
						 <img src="https://techcodeview.com/img/strings/19/roman-to-integer-conversion.webp" onerror="this.onerror=null; this.src='https://techcodeview.com/template/assets/images/unnamed.webp'" alt="Rimsko v celo število pretvorbo" class="w-full h-full object-cover">
					 </a>
				 </div>
				 <div class="flex-1 min-w-0">
					 <h4 class="text-sm font-semibold text-slate-800 dark:text-slate-200 leading-snug">
                         <a href="/sl/roman-to-integer-conversion" class="hover:text-tech-500 transition-colors line-clamp-3">Rimsko v celo število pretvorbo </a>
                     </h4>
				 </div>
			 </article>
			 <!-- /ARTICLE --> <!-- ARTICLE -->
			 <article class="flex items-start gap-4 p-2 hover:bg-slate-50 dark:hover:bg-slate-700/50 rounded-lg transition-colors">
				 <div class="w-20 h-20 shrink-0 overflow-hidden rounded-md bg-slate-200 dark:bg-slate-700">
					 <a href="/sl/dining-philosophers-problem">
						 <img src="https://techcodeview.com/img/operating-system/98/dining-philosophers-problem.webp" onerror="this.onerror=null; this.src='https://techcodeview.com/template/assets/images/unnamed.webp'" alt="PROBLEM FILOZOFOV JEDIL" class="w-full h-full object-cover">
					 </a>
				 </div>
				 <div class="flex-1 min-w-0">
					 <h4 class="text-sm font-semibold text-slate-800 dark:text-slate-200 leading-snug">
                         <a href="/sl/dining-philosophers-problem" class="hover:text-tech-500 transition-colors line-clamp-3">PROBLEM FILOZOFOV JEDIL </a>
                     </h4>
				 </div>
			 </article>
			 <!-- /ARTICLE --> <!-- ARTICLE -->
			 <article class="flex items-start gap-4 p-2 hover:bg-slate-50 dark:hover:bg-slate-700/50 rounded-lg transition-colors">
				 <div class="w-20 h-20 shrink-0 overflow-hidden rounded-md bg-slate-200 dark:bg-slate-700">
					 <a href="/sl/national-merit-finalist-how-win-scholarship-1311480">
						 <img src="https://techcodeview.com/img/blog/32/national-merit-finalist-how-win-scholarship.webp" onerror="this.onerror=null; this.src='https://techcodeview.com/template/assets/images/unnamed.webp'" alt="Nacionalni finalist za zasluge - Kako pridobiti štipendijo" class="w-full h-full object-cover">
					 </a>
				 </div>
				 <div class="flex-1 min-w-0">
					 <h4 class="text-sm font-semibold text-slate-800 dark:text-slate-200 leading-snug">
                         <a href="/sl/national-merit-finalist-how-win-scholarship-1311480" class="hover:text-tech-500 transition-colors line-clamp-3">Nacionalni finalist za zasluge - Kako pridobiti štipendijo </a>
                     </h4>
				 </div>
			 </article>
			 <!-- /ARTICLE --> <!-- ARTICLE -->
			 <article class="flex items-start gap-4 p-2 hover:bg-slate-50 dark:hover:bg-slate-700/50 rounded-lg transition-colors">
				 <div class="w-20 h-20 shrink-0 overflow-hidden rounded-md bg-slate-200 dark:bg-slate-700">
					 <a href="/sl/parents-guide-snapchat-242134">
						 <img src="https://techcodeview.com/img/parents/34/parents-guide-snapchat.webp" onerror="this.onerror=null; this.src='https://techcodeview.com/template/assets/images/unnamed.webp'" alt="Starši: vodnik po Snapchatu" class="w-full h-full object-cover">
					 </a>
				 </div>
				 <div class="flex-1 min-w-0">
					 <h4 class="text-sm font-semibold text-slate-800 dark:text-slate-200 leading-snug">
                         <a href="/sl/parents-guide-snapchat-242134" class="hover:text-tech-500 transition-colors line-clamp-3">Starši: vodnik po Snapchatu </a>
                     </h4>
				 </div>
			 </article>
			 <!-- /ARTICLE --> <!-- ARTICLE -->
			 <article class="flex items-start gap-4 p-2 hover:bg-slate-50 dark:hover:bg-slate-700/50 rounded-lg transition-colors">
				 <div class="w-20 h-20 shrink-0 overflow-hidden rounded-md bg-slate-200 dark:bg-slate-700">
					 <a href="/sl/intrusion-detection-system">
						 <img src="https://techcodeview.com/img/information-security/02/intrusion-detection-system.webp" onerror="this.onerror=null; this.src='https://techcodeview.com/template/assets/images/unnamed.webp'" alt="Sistem za zaznavanje vdorov (IDS)" class="w-full h-full object-cover">
					 </a>
				 </div>
				 <div class="flex-1 min-w-0">
					 <h4 class="text-sm font-semibold text-slate-800 dark:text-slate-200 leading-snug">
                         <a href="/sl/intrusion-detection-system" class="hover:text-tech-500 transition-colors line-clamp-3">Sistem za zaznavanje vdorov (IDS) </a>
                     </h4>
				 </div>
			 </article>
			 <!-- /ARTICLE --> <!-- ARTICLE -->
			 <article class="flex items-start gap-4 p-2 hover:bg-slate-50 dark:hover:bg-slate-700/50 rounded-lg transition-colors">
				 <div class="w-20 h-20 shrink-0 overflow-hidden rounded-md bg-slate-200 dark:bg-slate-700">
					 <a href="/sl/local-maxima-minima-calculus">
						 <img src="https://techcodeview.com/img/calculus/95/local-maxima-minima-calculus.webp" onerror="this.onerror=null; this.src='https://techcodeview.com/template/assets/images/unnamed.webp'" alt="Lokalni maksimumi in minimumi v računu" class="w-full h-full object-cover">
					 </a>
				 </div>
				 <div class="flex-1 min-w-0">
					 <h4 class="text-sm font-semibold text-slate-800 dark:text-slate-200 leading-snug">
                         <a href="/sl/local-maxima-minima-calculus" class="hover:text-tech-500 transition-colors line-clamp-3">Lokalni maksimumi in minimumi v računu </a>
                     </h4>
				 </div>
			 </article>
			 <!-- /ARTICLE --> <!-- ARTICLE -->
			 <article class="flex items-start gap-4 p-2 hover:bg-slate-50 dark:hover:bg-slate-700/50 rounded-lg transition-colors">
				 <div class="w-20 h-20 shrink-0 overflow-hidden rounded-md bg-slate-200 dark:bg-slate-700">
					 <a href="/sl/classification-algorithm-machine-learning">
						 <img src="https://techcodeview.com/img/machine-learning/97/classification-algorithm-machine-learning.webp" onerror="this.onerror=null; this.src='https://techcodeview.com/template/assets/images/unnamed.webp'" alt="Klasifikacijski algoritem v strojnem učenju" class="w-full h-full object-cover">
					 </a>
				 </div>
				 <div class="flex-1 min-w-0">
					 <h4 class="text-sm font-semibold text-slate-800 dark:text-slate-200 leading-snug">
                         <a href="/sl/classification-algorithm-machine-learning" class="hover:text-tech-500 transition-colors line-clamp-3">Klasifikacijski algoritem v strojnem učenju </a>
                     </h4>
				 </div>
			 </article>
			 <!-- /ARTICLE --> <!-- ARTICLE -->
			 <article class="flex items-start gap-4 p-2 hover:bg-slate-50 dark:hover:bg-slate-700/50 rounded-lg transition-colors">
				 <div class="w-20 h-20 shrink-0 overflow-hidden rounded-md bg-slate-200 dark:bg-slate-700">
					 <a href="/sl/objectmapper-class-jackson">
						 <img src="https://techcodeview.com/img/jackson-tutorial/72/objectmapper-class-jackson.webp" onerror="this.onerror=null; this.src='https://techcodeview.com/template/assets/images/unnamed.webp'" alt="Razred ObjectMapper v Jacksonu" class="w-full h-full object-cover">
					 </a>
				 </div>
				 <div class="flex-1 min-w-0">
					 <h4 class="text-sm font-semibold text-slate-800 dark:text-slate-200 leading-snug">
                         <a href="/sl/objectmapper-class-jackson" class="hover:text-tech-500 transition-colors line-clamp-3">Razred ObjectMapper v Jacksonu </a>
                     </h4>
				 </div>
			 </article>
			 <!-- /ARTICLE --> <!-- ARTICLE -->
			 <article class="flex items-start gap-4 p-2 hover:bg-slate-50 dark:hover:bg-slate-700/50 rounded-lg transition-colors">
				 <div class="w-20 h-20 shrink-0 overflow-hidden rounded-md bg-slate-200 dark:bg-slate-700">
					 <a href="/sl/type-adobe-illustrator">
						 <img src="https://techcodeview.com/img/adobe-illustrator/29/type-adobe-illustrator.webp" onerror="this.onerror=null; this.src='https://techcodeview.com/template/assets/images/unnamed.webp'" alt="Vnesite Adobe Illustrator" class="w-full h-full object-cover">
					 </a>
				 </div>
				 <div class="flex-1 min-w-0">
					 <h4 class="text-sm font-semibold text-slate-800 dark:text-slate-200 leading-snug">
                         <a href="/sl/type-adobe-illustrator" class="hover:text-tech-500 transition-colors line-clamp-3">Vnesite Adobe Illustrator </a>
                     </h4>
				 </div>
			 </article>
			 <!-- /ARTICLE --> <!-- ARTICLE -->
			 <article class="flex items-start gap-4 p-2 hover:bg-slate-50 dark:hover:bg-slate-700/50 rounded-lg transition-colors">
				 <div class="w-20 h-20 shrink-0 overflow-hidden rounded-md bg-slate-200 dark:bg-slate-700">
					 <a href="/sl/numberformatexception-java">
						 <img src="https://techcodeview.com/img/java-misc/69/numberformatexception-java.webp" onerror="this.onerror=null; this.src='https://techcodeview.com/template/assets/images/unnamed.webp'" alt="NumberFormatException v Javi" class="w-full h-full object-cover">
					 </a>
				 </div>
				 <div class="flex-1 min-w-0">
					 <h4 class="text-sm font-semibold text-slate-800 dark:text-slate-200 leading-snug">
                         <a href="/sl/numberformatexception-java" class="hover:text-tech-500 transition-colors line-clamp-3">NumberFormatException v Javi </a>
                     </h4>
				 </div>
			 </article>
			 <!-- /ARTICLE -->
		 </div>
		

         <!-- Categories -->
		 <div class="mt-8 mb-4 border-b border-slate-100 dark:border-slate-700 pb-2">
			 <h2 class="text-lg font-bold text-slate-900 dark:text-white uppercase tracking-wide">Kategorija </h2>
		 </div>
		 <div class="flex flex-wrap gap-2">
             <a href="/sl/blog/" class="inline-block px-3 py-1 bg-slate-100 dark:bg-slate-700 text-xs font-medium text-slate-600 dark:text-slate-300 rounded-full hover:bg-tech-500 hover:text-white transition-colors">
                Blog
             </a> <a href="/sl/java-conversion/" class="inline-block px-3 py-1 bg-slate-100 dark:bg-slate-700 text-xs font-medium text-slate-600 dark:text-slate-300 rounded-full hover:bg-tech-500 hover:text-white transition-colors">
                Java Conversion
             </a> <a href="/sl/maths/" class="inline-block px-3 py-1 bg-slate-100 dark:bg-slate-700 text-xs font-medium text-slate-600 dark:text-slate-300 rounded-full hover:bg-tech-500 hover:text-white transition-colors">
                Matematika
             </a> <a href="/sl/java-collections/" class="inline-block px-3 py-1 bg-slate-100 dark:bg-slate-700 text-xs font-medium text-slate-600 dark:text-slate-300 rounded-full hover:bg-tech-500 hover:text-white transition-colors">
                Zbirke Java
             </a> <a href="/sl/differences/" class="inline-block px-3 py-1 bg-slate-100 dark:bg-slate-700 text-xs font-medium text-slate-600 dark:text-slate-300 rounded-full hover:bg-tech-500 hover:text-white transition-colors">
                Razlike
             </a> <a href="/sl/java-string/" class="inline-block px-3 py-1 bg-slate-100 dark:bg-slate-700 text-xs font-medium text-slate-600 dark:text-slate-300 rounded-full hover:bg-tech-500 hover:text-white transition-colors">
                Java String
             </a>
         </div>

         <!-- Interesting Articles Widget -->
		 <div class="mt-8">
			 <div class="mb-4 border-b border-slate-100 dark:border-slate-700 pb-2">
				 <h2 class="text-lg font-bold text-slate-900 dark:text-white uppercase tracking-wide">Zanimivi Članki </h2>
			 </div>
			
			 <div id="owl-carousel-4" class="owl-carousel owl-theme">
				 <!-- ARTICLE -->
				 <article class="relative aspect-video rounded-lg overflow-hidden group mb-2">
					 <div class="absolute inset-0">
						 <img src="https://techcodeview.com/img/linux-tutorial/72/linux-tree-command.webp" onerror="this.onerror=null; this.src='https://techcodeview.com/template/assets/images/unnamed.webp'" alt="Ukaz drevesa Linux" class="w-full h-full object-cover group-hover:scale-105 transition-transform duration-500">
                         <div class="absolute inset-0 bg-gradient-to-t from-black/80 to-transparent"> </div>
					 </div>
					 <div class="absolute bottom-0 left-0 p-4">
						 <div class="text-xs text-tech-400 font-bold mb-1"> <a href="/sl/linux-tutorial/">Vadnica Za Linux </a> </div>
						 <h4 class="text-sm font-bold text-white leading-tight"> <a href="/sl/linux-tree-command">Ukaz drevesa Linux </a> </h4>
					 </div>
				 </article>
				 <!-- /ARTICLE --> <!-- ARTICLE -->
				 <article class="relative aspect-video rounded-lg overflow-hidden group mb-2">
					 <div class="absolute inset-0">
						 <img src="https://techcodeview.com/img/how/09/how-recover-deleted-snapchat-messages.webp" onerror="this.onerror=null; this.src='https://techcodeview.com/template/assets/images/unnamed.webp'" alt="Kako obnoviti izbrisana sporočila Snapchat?" class="w-full h-full object-cover group-hover:scale-105 transition-transform duration-500">
                         <div class="absolute inset-0 bg-gradient-to-t from-black/80 to-transparent"> </div>
					 </div>
					 <div class="absolute bottom-0 left-0 p-4">
						 <div class="text-xs text-tech-400 font-bold mb-1"> <a href="/sl/how/">Kako </a> </div>
						 <h4 class="text-sm font-bold text-white leading-tight"> <a href="/sl/how-recover-deleted-snapchat-messages">Kako obnoviti izbrisana sporočila Snapchat? </a> </h4>
					 </div>
				 </article>
				 <!-- /ARTICLE --> <!-- ARTICLE -->
				 <article class="relative aspect-video rounded-lg overflow-hidden group mb-2">
					 <div class="absolute inset-0">
						 <img src="https://techcodeview.com/img/gblog-2024/51/top-10-object-oriented-programming-languages-2024.webp" onerror="this.onerror=null; this.src='https://techcodeview.com/template/assets/images/unnamed.webp'" alt="10 najboljših objektno orientiranih programskih jezikov v letu 2024" class="w-full h-full object-cover group-hover:scale-105 transition-transform duration-500">
                         <div class="absolute inset-0 bg-gradient-to-t from-black/80 to-transparent"> </div>
					 </div>
					 <div class="absolute bottom-0 left-0 p-4">
						 <div class="text-xs text-tech-400 font-bold mb-1"> <a href="/sl/gblog-2024-cat/">Gblog 2024 </a> </div>
						 <h4 class="text-sm font-bold text-white leading-tight"> <a href="/sl/top-10-object-oriented-programming-languages-2024">10 najboljših objektno orientiranih programskih jezikov v letu 2024 </a> </h4>
					 </div>
				 </article>
				 <!-- /ARTICLE --> <!-- ARTICLE -->
				 <article class="relative aspect-video rounded-lg overflow-hidden group mb-2">
					 <div class="absolute inset-0">
						 <img src="https://techcodeview.com/img/bit-magic/98/equal-sum-and-xor.webp" onerror="this.onerror=null; this.src='https://techcodeview.com/template/assets/images/unnamed.webp'" alt="Enaka vsota in XOR" class="w-full h-full object-cover group-hover:scale-105 transition-transform duration-500">
                         <div class="absolute inset-0 bg-gradient-to-t from-black/80 to-transparent"> </div>
					 </div>
					 <div class="absolute bottom-0 left-0 p-4">
						 <div class="text-xs text-tech-400 font-bold mb-1"> <a href="/sl/bit-magic/">Bit Magic </a> </div>
						 <h4 class="text-sm font-bold text-white leading-tight"> <a href="/sl/equal-sum-and-xor">Enaka vsota in XOR </a> </h4>
					 </div>
				 </article>
				 <!-- /ARTICLE --> <!-- ARTICLE -->
				 <article class="relative aspect-video rounded-lg overflow-hidden group mb-2">
					 <div class="absolute inset-0">
						 <img src="https://techcodeview.com/img/blog/19/9-best-film-schools-us.webp" onerror="this.onerror=null; this.src='https://techcodeview.com/template/assets/images/unnamed.webp'" alt="9 najboljših filmskih šol v ZDA" class="w-full h-full object-cover group-hover:scale-105 transition-transform duration-500">
                         <div class="absolute inset-0 bg-gradient-to-t from-black/80 to-transparent"> </div>
					 </div>
					 <div class="absolute bottom-0 left-0 p-4">
						 <div class="text-xs text-tech-400 font-bold mb-1"> <a href="/sl/blog/">Blog </a> </div>
						 <h4 class="text-sm font-bold text-white leading-tight"> <a href="/sl/9-best-film-schools-us-131816">9 najboljših filmskih šol v ZDA </a> </h4>
					 </div>
				 </article>
				 <!-- /ARTICLE --> <!-- ARTICLE -->
				 <article class="relative aspect-video rounded-lg overflow-hidden group mb-2">
					 <div class="absolute inset-0">
						 <img src="https://techcodeview.com/img/automata-tutorial/08/examples-dfa.webp" onerror="this.onerror=null; this.src='https://techcodeview.com/template/assets/images/unnamed.webp'" alt="Primeri DFA" class="w-full h-full object-cover group-hover:scale-105 transition-transform duration-500">
                         <div class="absolute inset-0 bg-gradient-to-t from-black/80 to-transparent"> </div>
					 </div>
					 <div class="absolute bottom-0 left-0 p-4">
						 <div class="text-xs text-tech-400 font-bold mb-1"> <a href="/sl/automata-tutorial/">Samodejna Vadnica </a> </div>
						 <h4 class="text-sm font-bold text-white leading-tight"> <a href="/sl/examples-dfa">Primeri DFA </a> </h4>
					 </div>
				 </article>
				 <!-- /ARTICLE -->
			 </div>
		 </div>
	 </div>
 </div>
 <!-- /Aside Column -->         </div>
        </div>
     </div>

 <footer class="site-footer">
         <div class="container">
             <span class="footer-links">
                Copyright ©2026 Vse Pravice Pridržane | 
                 <a href="//www.techcodeview.com/pt/">techcodeview.com </a> | 
                 <a href="/disclaimer" rel="nofollow noopener noreferrer" target="_blank">Zavrnitev Odgovornosti </a> | 
                 <a href="/about-us" rel="nofollow noopener noreferrer" target="_blank">O Podjetju </a> | 
                 <a href="/privacy-policy" rel="nofollow noopener noreferrer" target="_blank">Politika Zasebnosti </a> 
             </span>
         </div>
     </footer>
 
     <script type="text/javascript" src="https://techcodeview.com/template/assets/plugins/jquery-1.11.3.min.js"> </script>
     <script type="text/javascript" src="https://techcodeview.com/template/assets/plugins/bootstrap/js/bootstrap.min.js"> </script>    
     <script type="text/javascript" src="https://techcodeview.com/template/assets/js/main.js"> </script>     
	 <script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/11.5.1/highlight.min.js"> </script>
	 <script>
    !function(){"use strict";let t=document.createElement("button");t.id="toTopBtn",t.innerHTML="↑";let e=`
        #toTopBtn {
            position: fixed; bottom: 25px; right: 25px; z-index: 9999; opacity: 0; visibility: hidden; background-color: #0ea5e9; color: white; border: none; border-radius: 8px; width: 50px; height: 50px; font-size: 24px; cursor: pointer; transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
        }
        #toTopBtn:hover { background-color: #0284c7; }
    `,i=document.createElement("style");i.type="text/css",i.innerText=e,document.head.appendChild(i),document.body.appendChild(t),window.addEventListener("scroll",()=>{let e=window.scrollY||document.documentElement.scrollTop;e>300?(t.style.opacity="1",t.style.visibility="visible"):(t.style.opacity="0",t.style.visibility="hidden")}),t.addEventListener("click",()=>{window.scrollTo({top:0,behavior:"smooth"})})}();
     </script>
 </body>
 </html>