-
Posts
52 -
Joined
-
Last visited
About jac.kock
- Birthday 11/08/1977
Profile Information
-
Gender
Male
-
Location
netherland
jac.kock's Achievements

Member (2/5)
0
Reputation
-
need help can get multiple instances to work!
jac.kock replied to jac.kock's topic in Javascript Help
Can some help me with this problem??? thnx all -
need help can get multiple instances to work!
jac.kock replied to jac.kock's topic in Javascript Help
oke thnx i see what you mean now, but how do i call this function and how do i make this function universial to call and set 1. timers 2. file to load 3. div name to refresh? thnx alot already:) -
need help can get multiple instances to work!
jac.kock replied to jac.kock's topic in Javascript Help
oke that i find logical, however i dont understand ajax and jquery very wel i understand it a bit im a newbee about those languages :| can you write the proper code for this and i understan wath you mean with the timer problems and thats no issue because the most times a div wil be refreshed is not at the same time's some take 30 sec some 5 min ect. thnx for your fine answer and i'll hope that you will help me with the code! -
need help can get multiple instances to work!
jac.kock replied to jac.kock's topic in Javascript Help
hi, so it is 2014 and this solves my problem, this is youre help??? I said i 'm not very good or good with this! so please explain how i gonna solve this with 'Jquery' or how to implement this in the file? all i need is one simple function to call trough out the website formthe div's i want to refresh and set a different refresh rate (seconds) to them!! so please help me if tryed to change it for weeks and i can seem to get i right! thnx -
hi all, i'm not very good whit AJAX and i cant seem to get it to work properly i have a ajax script that i use in my website and it works fine for one div to refresh, i want to edit the script so i can use it for more div's to refresh so i need to make it ready to more than 1 instance of the script. now i have edit the script and now the both div's ( more in the future) refresh every second and not at the specified time's i included both the original and edit script! Can some please help me to get it to work? PHP to call the script: <?php ?> <style type="text/css"> .head-tr { border-color: #FF2A2A; } .head-td { border-width: 7px; border-style: outset; border-color: #FF2A2A; } </style> <table width="200"> <tr> <td valign="top" align="top" bgcolor="#BE1F1F"> <script type="text/javascript"><!-- // orginal script call refreshdiv(); // --> </script> <div id="shownews"></div> </td> </tr> </table> <table width="200"> <tr> <td valign="top" align="top" bgcolor="#BE1F1F"> <script type="text/javascript"><!-- // edited script call refreshdiv(30,'mynews','table.php'); // --> </script> <div id="mynews"></div> </td> </tr> </table> Script orginal: // Customise those settings var seconds = 30; var divid = "shownews"; var url = "table.php"; //////////////////////////////// // // Refreshing the DIV // //////////////////////////////// function refreshdiv(){ // The XMLHttpRequest object var xmlHttp; try{ xmlHttp=new XMLHttpRequest(); // Firefox, Opera 8.0+, Safari } catch (e){ try{ xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); // Internet Explorer } catch (e){ try{ xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } catch (e){ alert("Your browser does not support AJAX."); return false; } } } // Timestamp for preventing IE caching the GET request fetch_unix_timestamp = function() { return parseInt(new Date().getTime().toString().substring(0, 10)) } var timestamp = fetch_unix_timestamp(); var nocacheurl = url+"?t="+timestamp; // The code... xmlHttp.onreadystatechange=function(){ if(xmlHttp.readyState==4){ document.getElementById(divid).innerHTML=xmlHttp.responseText; setTimeout('refreshdiv()',seconds*1000); } } xmlHttp.open("GET",nocacheurl,true); xmlHttp.send(null); } // Start the refreshing process var seconds; window.onload = function startrefresh(){ setTimeout('refreshdiv()',seconds*1000); } Script edited: // Customise those settings //////////////////////////////// // // Refreshing the DIV // //////////////////////////////// function refreshdiv(mysec,mydiv,myurl){ var seconds = mysec; var divid = mydiv; var url = myurl; // The XMLHttpRequest object var xmlHttp; try{ xmlHttp=new XMLHttpRequest(); // Firefox, Opera 8.0+, Safari } catch (e){ try{ xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); // Internet Explorer } catch (e){ try{ xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } catch (e){ alert("Your browser does not support AJAX."); return false; } } } // Timestamp for preventing IE caching the GET request fetch_unix_timestamp = function() { return parseInt(new Date().getTime().toString().substring(0, 10)) } var timestamp = fetch_unix_timestamp(); var nocacheurl = url+"?t="+timestamp; // The code... xmlHttp.onreadystatechange=function(){ if(xmlHttp.readyState==4){ document.getElementById(divid).innerHTML=xmlHttp.responseText; setTimeout(refreshdiv(mysec,mydiv,myurl),seconds*1000); } } xmlHttp.open("GET",nocacheurl,true); xmlHttp.send(null); } // Start the refreshing process var seconds; window.onload = function startrefresh(){ setTimeout(refreshdiv(mysec,mydiv,myurl),seconds*1000); } PHP witch shows the page: <?php if(file_exists("../../support/connect.dat")) // user,pass and database file { include("../../support/connect.dat"); // database connection file } //################ connect to database ############## $link=mysql_connect($host, $user, $pass) or die(mysql_error()); mysql_select_db($data); $res=''; $res1=''; $sql="Select * from headlights where delete_tab='0' ORDER BY RAND() LIMIT 1"; // get only the none deleted! $res1=mysql_query($sql); $res=mysql_fetch_array($res1); $hltxt=$res["krant_item"]; if($hltxt=='') { $hltxt="Geen nieuws items gevonden."; } ?> <!-- show the selected one --> <table width="100%"> <tr> <td class="head-td" valign="top" align="top" bgcolor="#FF2A2A"> <font color="white" size="6px">Nieuws:</font> </td> </tr> <tr> <td class="head-td" height="150px" valign="top" align="top"> <font color="white"><? echo $hltxt; // show the none deleted item?></font> </td> </tr> </table> thnx all!
-
fixed by cheating the core system
-
hi all, i have on my site a style that creates a button like style from the TR and TD butt, now after the update from IE 9 tot 11 i only see a black border and not the raised gray whit border i used to see? this is my css style used in the index can someone help me to get it working agian? <style type="text/css"> .button-tr { border-width: 3px; border-style: outset; border-collapse: collapse; } .button-td { border-width: medium; border-style: outset; } </style> thanx all
-
hi all, I have a opensource wysiwyg editor on my site for posting messages and making pages, i work with IE and i noticed that the java script wont work in Google Chrome! I have tryed to look at it but its to complex for me i hope that there is someone how can and will help me to make the script compatible with Chrome. I have attached the file that is yhe core of the editor if anyone needs more i will make it avalible. thanx all. wysiwyg.js.txt
-
thnx all i get a reding so i can continu
-
hi, i want to use 1 form for more options so i have named them differant. I wnat to review the POST to see witch action must be taken there exp: if del then del_user if add then add_user if abuse then abuse_report do you know what i mean? can you help me to get the right steps?
-
how can help me to get the post in my code i been try'ng for days:( my code: <?php if($_POST['Submit']) { echo "Submit here"; } if($_POST['del']) { echo "del here"; } if($_POST['add']) { echo "add here"; } ?> <table width="100%" align="top" border="1"> <tr> <td align="top" valign="top"> <!-- START: profile photo and options --> <table width="100%"> <tr> <td align="center" valign="center"> <img src="upload/users/<?=$x['user_photo'];?>" width="140px" height="187px" alt="<?=$x['user_name'];?>" /> </td> </tr> <tr> <td align="top" valign="left"> <form name="proinfo" action="?<?=$_SERVER['QUERY_STRING'];?>" method="post" enctype="multipart/form-data"> <input type="hidden" id="abuseid" name="abuseid" value="<?=$x['user_id'];?>"/> <input type="hidden" id="fromid" name="fromid" value="<?=$log['user_id'];?>"/> <input name="abuse" type="image" id="abuse" value="Submit" src="modules/community/abuse.png" alt="" width="20" height="20" border="0" align="absmiddle"> report<br /> <input name="add" type="image" id="add" value="add" src="modules/community/abuse.png" alt="" width="20" height="20" border="0" align="absmiddle"> add<br /> <input name="del" type="image" id="del" value="del" src="modules/community/abuse.png" alt="" width="20" height="20" border="0" align="absmiddle"> del<br /> </form> </td> </tr> </table> <!-- END: profile photo and options --> </td> </tr> </table> i can't seem to get the post what am i doing wrong? pls help
-
yes it works fine jessica thnx a lot
-
like this jessica? <?php if(file_exists("../../support/connect.dat")) // user,pass and database file { include("../../support/connect.dat"); // database connection file } //################ connect to database ############## $link=mysql_connect($host, $user, $pass) or die(mysql_error()); mysql_select_db($data); $sql="Select * from headlights where delete_tab='0' ORDER BY RAND()"; // get only the none deleted! $res1=mysql_query($sql); $res=mysql_fetch_array($res1); ?> <!-- show the selected one --> <table width="100%"> <tr> <td class="head-td" height="150px" valign="top" align="top"> <? echo $res["krant_item"]; // show the none deleted item?> </td> </tr> </table> or is this the wrong way? thnx jassica
-
oke i get what you mean but i have no idea how to do this will you edit my code to what youre saying? thnx jessica!
-
what i mean is i want to display 0ne and not all of the none deleted ones!!! thats why i use rnd how can i show only the selected one by rnd?