Centar za edukaciju-BiH


switch Lista naslova: Koristan JavaScript kod
Stranice (7):1,2,3,4,5,6,7

#31 08.07.2013 21:42
zxz Van mreze
Administrator
Registrovan od:03.02.2009
Postovi:10,642


Predmet:Dialog box open
PreuzmiIzvorni kôd (HTML):
  1. <TITLE>Open dialog box</TITLE>
  2. </HEAD>
  3. <form method="post" action="">
  4. <table width="95%" border="0" align="center">
  5.     <tr>
  6.         <td width="76%">
  7.             <input type="file" name="file" enctype = "multipart/form-data">
  8.         </td>
  9.     </tr>
  10. </form>
  11. </BODY>
  12. </HTML>

Podrska samo putem foruma, jer samo tako i ostali imaju koristi od toga.
↑  ↓

#32 08.09.2013 08:49
zxz Van mreze
Administrator
Registrovan od:03.02.2009
Postovi:10,642


Predmet:Primjer for petlje
PreuzmiIzvorni kôd (HTML):
  1. <META NAME="generator" CONTENT="toniarts easyhtml v.2.4">
  2. <TITLE>Title of your page</TITLE>
  3. </HEAD>
  4. <script language="JavaScript">
  5. <!--
  6. cars=["Mrkva","Persun","Paradajz","Cvekla","Luk","Krompir","Rotkva","Krastavac","Bijeli luk","Kupus"];
  7. for (var i=0;i<cars.length;i++)
  8. {
  9. document.write(cars[i] + "<br>");
  10. }
  11. //-->
  12.  
  13. </BODY>
  14. </HTML>

PreuzmiIzvorni kôd (HTML):
  1. <META NAME="generator" CONTENT="toniarts easyhtml v.2.4">
  2. <TITLE>Title of your page</TITLE>
  3. </HEAD>
  4. <script language="JavaScript">
  5. cars=["Mrkva","Persun","Paradajz","Cvekla","Luk","Krompir","Rotkva","Krastavac","Bijeli luk","Kupus"];
  6.  var i=0;
  7.  for (;cars[i];)
  8.  {
  9.  document.write(cars[i] + "<br>");
  10.  i++;
  11.  }
  12.  </script>
  13. </BODY>
  14. </HTML>

Podrska samo putem foruma, jer samo tako i ostali imaju koristi od toga.
Ovaj post je ureden 1 puta. Posljednja izmjena 08.09.2013 09:10 od strane zxz. ↑  ↓

#33 15.09.2013 08:42
zxz Van mreze
Administrator
Registrovan od:03.02.2009
Postovi:10,642


Predmet:Primjer do petlje
PreuzmiIzvorni kôd (HTML):
  1. <META NAME="generator" CONTENT="toniarts easyhtml v.2.4">
  2. <TITLE>Title of your page</TITLE>
  3. </HEAD>
  4. <script language="JavaScript">
  5. <!--
  6. var i=0;
  7. var x=0;
  8. do
  9.   {
  10.  x= x + "Broj je: " + i ;
  11.  i++;
  12.  document.write(x + "<br>");
  13.   }
  14. while (i<5);
  15. //-->
  16. </BODY>
  17. </HTML>

Podrska samo putem foruma, jer samo tako i ostali imaju koristi od toga.
↑  ↓

#34 09.11.2013 20:56
zxz Van mreze
Administrator
Registrovan od:03.02.2009
Postovi:10,642


Predmet:Izvjestaj o browseru
PreuzmiIzvorni kôd (HTML):
  1. <META NAME="generator" CONTENT="toniarts easyhtml v.2.4">
  2. <TITLE>Title of your page</TITLE>
  3. </HEAD>
  4. <div id="example"></div>
  5.  
  6.  <script>
  7.  
  8.  txt = "<p>Browser CodeName: " + navigator.appCodeName + "</p>";
  9.  txt+= "<p>Browser ime: " + navigator.appName + "</p>";
  10.  txt+= "<p>Browser Verzija: " + navigator.appVersion + "</p>";
  11.  txt+= "<p>Cookie aktiviran: " + navigator.cookieEnabled + "</p>";
  12.  txt+= "<p>Platforma: " + navigator.platform + "</p>";
  13.  txt+= "<p>User-agent header: " + navigator.userAgent + "</p>";
  14.  txt+= "<p>User-agent language: " + navigator.systemLanguage + "</p>";
  15.  
  16.  document.getElementById("example").innerHTML=txt;
  17.  
  18.  </script>
  19. </BODY>
  20. </HTML>

Podrska samo putem foruma, jer samo tako i ostali imaju koristi od toga.
↑  ↓

#35 22.11.2013 12:23
zxz Van mreze
Administrator
Registrovan od:03.02.2009
Postovi:10,642


Predmet:Jezik browser cokie itd..
PreuzmiIzvorni kôd (HTML):
  1. <META NAME="generator" CONTENT="toniarts easyhtml v.2.4">
  2. <TITLE>Title of your page</TITLE>
  3. </HEAD>
  4. <div id="example"></div>
  5.  
  6.  <script>
  7.  
  8.  txt= "<p>Browser Ime: " + navigator.appName + "</p>";
  9.  txt+= "<p>Browser Verzija: " + navigator.appVersion + "</p>";
  10.  txt+= "<p>Cookies Omoguen: " + navigator.cookieEnabled + "</p>";
  11.  txt+= "<p>Platforma: " + navigator.platform + "</p>";
  12.  txt+= "<p>User-agent header: " + navigator.userAgent + "</p>";
  13.  txt+= "<p>Jezik: " + navigator.systemLanguage + "</p>";
  14.  
  15.  document.getElementById("example").innerHTML=txt;
  16.  
  17.  </script>
  18. </BODY>
  19. </HTML>

Podrska samo putem foruma, jer samo tako i ostali imaju koristi od toga.
↑  ↓

#36 12.04.2014 20:14
zxz Van mreze
Administrator
Registrovan od:03.02.2009
Postovi:10,642


Predmet:Koliko ste puta posjetili stranicu
Pokazuje koliko ste puta bili na stranici.
PreuzmiIzvorni kôd (HTML):
  1. <META NAME="generator" CONTENT="toniarts easyhtml v.2.4">
  2. <TITLE>Title of your page</TITLE>
  3. .counter{
  4. background-color:black;
  5. color:yellow;
  6. font-weight:bold;
  7. }
  8.  
  9. expireDate = new Date
  10. expireDate.setMonth(expireDate.getMonth()+6)
  11. jcount = eval(cookieVal("jaafarCounter"))
  12. jcount++
  13. document.cookie = "jaafarCounter="+jcount+";expires=" + expireDate.toGMTString()
  14.  
  15. function cookieVal(cookieName) {
  16. thisCookie = document.cookie.split("; ")
  17. for (i=0; i<thisCookie.length; i++){
  18.         if (cookieName == thisCookie[i].split("=")[0]){
  19.                 return thisCookie[i].split("=")[1]
  20.         }
  21. }
  22. return 0
  23. }
  24.  
  25. function page_counter(){
  26. for (i=0;i<(7-jcount.toString().length);i++)
  27. document.write('<span class="counter">0</span>')
  28. for (y=0;y<(jcount.toString().length);y++)
  29. document.write('<span class="counter">'+jcount.toString().charAt(y)+'</span>')
  30. }
  31.  
  32.  
  33.  
  34. </HEAD>
  35. Na ovoj stranici ste bili
  36. page_counter(jcount);
  37. -puta!
  38.  
  39. </BODY>
  40. </HTML>

Podrska samo putem foruma, jer samo tako i ostali imaju koristi od toga.
↑  ↓

#37 04.12.2014 11:42
zxz Van mreze
Administrator
Registrovan od:03.02.2009
Postovi:10,642


Predmet:Dialog box vise redova teksta
Primjer dialog boxa sa tekstom u vise redova.
Za prekazak u novi red koristi se "\n"
PreuzmiIzvorni kôd (HTML):
  1. <!DOCTYPE html>
  2.  
  3. <p>Klikni na taster ispod</p>
  4.  
  5. <button onclick="myFunction()">Klikni</button>
  6.  
  7. function myFunction() {
  8.     alert("Prvi red teksta\nDrugi red teksta\nTreci red teksta");
  9. }
  10.  
  11. </body>
  12. </html>

Podrska samo putem foruma, jer samo tako i ostali imaju koristi od toga.
↑  ↓

#38 04.12.2014 12:33
zxz Van mreze
Administrator
Registrovan od:03.02.2009
Postovi:10,642


Predmet:Setajuci tekst-2
Ovo je neprekidni setajuci tekst sa desna na lijevo.
PreuzmiIzvorni kôd (HTML):
  1. <META NAME="generator" CONTENT="toniarts easyhtml v.2.4">
  2. <TITLE>Title of your page</TITLE>
  3. </HEAD>
  4. <script language="Javascript">
  5. <!--
  6. var speed = 100
  7. var message = "Ovdje vas tekst koji treba da se verti   "
  8.  
  9. var s = 0
  10. var l = message.length
  11. document.write("<form name='forma'><input type='text'SIZE='30'"
  12. +"name='moj' value='"+ message +"'></form>")
  13. function taster() {
  14.  
  15. document.forma.moj.value = message.substring(s,l) + message.substring(0,s)
  16. s++
  17.  
  18. if (s >= l) {
  19. s = 0
  20. }
  21.  
  22. setTimeout("taster()",speed)
  23. }
  24.  
  25. taster();
  26. //-->
  27. </BODY>
  28. </HTML>

Podrska samo putem foruma, jer samo tako i ostali imaju koristi od toga.
↑  ↓

#39 04.12.2014 13:33
zxz Van mreze
Administrator
Registrovan od:03.02.2009
Postovi:10,642


Predmet:Baner sa tekstom
Dinamicki baner.
Mozete dodati svoj tekst i to nekoliko tekstova.
Ukoliko zelite mozete postaviti i sliku. Ako nesto ne ide pitajte na forumu.

PreuzmiIzvorni kôd (HTML):
  1. <META NAME="generator" CONTENT="toniarts easyhtml v.2.4">
  2. <TITLE>Title of your page</TITLE>
  3. </HEAD>
  4. <!-- STEP ONE: Paste this code into the BODY of your HTML document -->
  5. <script language="JavaScript">
  6. <!-- Begin
  7. var qiksearch_js_text = new Array (" ovde ide vaš tekst ", " ovde ide vaš tekst ", " ovde ide vaš tekst ", " ovde ide vaš tekst !!!");
  8. var qiksearch_space_width = "890"; // The width of the content spac
  9. var qiksearch_space_height = "80"; // The height of the content space
  10. var qiksearch_space_borderw="3"; // Border width
  11. var qiksearch_space_borderc="#004891"; // Border Color
  12. var timeOutVal="150"; // Delay in milliseconds
  13.  
  14.  
  15. document.write('<table width="' + qiksearch_space_width + '" height="' + qiksearch_space_height + '" style="background:#FFFFAA; border:' + qiksearch_space_borderw + ' solid ' + qiksearch_space_borderc + '"><tr><td align="middle">');
  16. document.write('<div id="qiksearch_js_space">');
  17. document.write('</div>');
  18. document.write('</td></tr></table>');
  19.  
  20. var def_10='A',def_11='B',def_12='C',def_13='D',def_14='E',def_15='F';
  21. var colorVal=15;
  22. var div_count=0;
  23.  
  24. function qiksearch_fade_desat(getColorIntVal)
  25. {
  26. var returnVal;
  27. if(getColorIntVal>=10)
  28. {
  29. for(var i=0; i<=15; i++)
  30. {
  31. if((getColorIntVal==i))
  32. {
  33. returnVal = eval('def_' + i);
  34. }
  35. }
  36. }
  37. else
  38. {
  39. returnVal=getColorIntVal;
  40. }
  41. return(returnVal);
  42. }
  43. function writeDiv()
  44. {
  45. document.all.qiksearch_js_space.innerHTML= '<font face="verdana,arial,helvetica" size="4" color="' + joinColor(qiksearch_fade_desat(colorVal)) + '"><b>' + qiksearch_js_text[div_count] + '</span></b></font>' ;
  46.  
  47. if((colorVal>0) && (colorVal!=0))
  48. {
  49. colorVal--;
  50. }
  51. else
  52. {
  53. colorVal=15;
  54. if(div_count<qiksearch_js_text.length)
  55. {
  56. div_count++;
  57. }
  58. if(div_count==qiksearch_js_text.length)
  59. {
  60. document.all.qiksearch_js_space.innerHTML = '<a href="javascript:resetAll();writeDiv();" style="text-decoration:none" accesskey="l"><font color="#808080" face="verdana,arial,helvetica" size="-1"><b>N<u></u>eki drugi teks <font color="#CC0000">t</font></b></font></a>';
  61. }
  62. }
  63. if(div_count<qiksearch_js_text.length)
  64. {
  65. setTimeout("writeDiv()",timeOutVal);
  66. }
  67. }
  68. function joinColor(getColor)
  69. {
  70. return (getColor + '0' + getColor + '0' + getColor + '0');
  71. }
  72. function resetAll()
  73. {
  74. div_count=0;
  75. colorVal=15;
  76. }
  77. writeDiv();
  78. // End -->
  79. </BODY>
  80. </HTML>

Podrska samo putem foruma, jer samo tako i ostali imaju koristi od toga.
↑  ↓

#40 04.12.2014 13:49
zxz Van mreze
Administrator
Registrovan od:03.02.2009
Postovi:10,642


Predmet:Dan u sedmici
Ovaj kod ce vam izbaciti koji je dan u sedmici.
PreuzmiIzvorni kôd (HTML):
  1. <META NAME="generator" CONTENT="toniarts easyhtml v.2.4">
  2. <TITLE>Title of your page</TITLE>
  3. </HEAD>
  4.  <script>
  5. <!--
  6. <!--Week Of The Day Image Displayer script -->
  7. var mondayimg=" Ponedjeljak "
  8. var tuesdayimg=" Utorak "
  9. var wednesdayimg=" Srijeda "
  10. var thursdayimg=" etvrtak "
  11. var fridayimg=" Petak "
  12. var saturdayimg=" Subota "
  13. var sundayimg=" Nedjelja "
  14. var mydate=new Date()
  15. var today=mydate.getDay()
  16. document.write("Mjesec: "+ mydate.getMonth())
  17. if (today==1)
  18. document.write(mondayimg)
  19. else if (today==2)
  20. document.write(tuesdayimg)
  21. else if (today==3)
  22. document.write(wednesdayimg)
  23. else if (today==4)
  24. document.write(thursdayimg)
  25. else if (today==5)
  26. document.write(fridayimg)
  27. else if (today==6)
  28. document.write(saturdayimg)
  29. else
  30. document.write(sundayimg)
  31. //-->
  32.  
  33. <p align="center"><font face="arial" size="-2"></font><br>
  34. <font face="arial, helvetica" size="-2"><a href="">
  35. </a></font></p>
  36. </BODY>
  37. </HTML>

Podrska samo putem foruma, jer samo tako i ostali imaju koristi od toga.
↑  ↓

Stranice (7):1,2,3,4,5,6,7


Sva vremena su GMT +01:00. Trenutno vrijeme: 11: 58 pm.