Jquery bug

Gestart doorAntonn12 reacties33 weergaven

13 berichten · pagina 1 van 1

Antonn

Lid · Topicstarter

Berichten
8.649
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
function refreshspy()
{
     $(#spyrows).load("admin/jquery/spy.php?rows="+document.forms[spyform].spyinput.value+"&search="+document.forms[spyform].spysearch.value+"").fadeIn("slow");
}


De oude input blijft staan in de div met het id "spyrows". Wat kan het zijn? Ik include normaal de API wel.

Alvast bedankt!

Mvg, Anton
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Misschien eerst

$(#spyrows).html("");

Om de innerHTML te resetten?
0
Thom

Lid

Berichten
10.654
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Probeer is F12 & dan console.. wat zie je ?
0
Antonn

Lid · Topicstarter

Berichten
8.649
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Thommiee schreef:
Probeer is F12 & dan console.. wat zie je ?
Spoiler tonen
Afbeelding
Rik schreef:
Misschien eerst

$(#spyrows).html("");

Om de innerHTML te resetten?
Zelfde error als hierboven, alleen met jou code ipv dat andere.
0
Berichten
2.609
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Vriendje is een systeem voor mijn website aan het maken.

Hij moest gaan dus hierbij laat ik even zien wat hij aangeeft:
Afbeelding

function refreshspy()
{
     $(#spyrows).load("admin/jquery/spy.php?rows="+document.forms[spyform].spyinput.value+"&search="+document.forms[spyform].spysearch.value+"").fadeIn("slow");
}


//Dit is hele script trouwens:

<script type="text/javascript">
function editspy(str,ser)
{
if (str=="")
  {
  document.getElementById("spyrows").innerHTML=<div id="error">Er is geen aantal rows opgegeven!</div>;
  return;
  }
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById("spyrows").innerHTML=xmlhttp.responseText;
    }
  }
xmlhttp.open("GET","admin/jquery/spy.php?rows="+str+"&search="+ser,true);
xmlhttp.send();
}

function refreshspy()
{

     $(#spyrows).load("admin/jquery/spy.php?rows="+document.forms[spyform].spyinput.value+"&search="+document.forms[spyform].spysearch.value+"").fadeIn("slow");
Uncaught TypeError: Cannot read property spyinput of undefined
}

var refreshId = setInterval(refreshspy() , 1000);
</script>
0
Thom

Lid

Berichten
10.654
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hij weet niet wat spyinput is, en ik trouwens ook niet smile
0
Berichten
2.609
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Thommiee schreef:
Hij weet niet wat spyinput is, en ik trouwens ook niet smile
Dit:

<tr>
<td style="width: 15%; text-align: right;">Aantal rijen:</td>
<td style="width: 18%;"><select name="spyselect" style="width: 150px;" onchange="editspy(this.value,document.forms[spyform].spysearch.value);document.forms[spyform].spyinput.value = this.value; return false;">
<option value=""> - Selecteer aantal - </option>
<option value="20">20 laatste</option>
<option value="50">50 laatste</option>
<option value="100">100 laatste</option>
<option value="200">200 laatste</option>
<option value="500">500 laatste</option>
</select></td>
<td style="width: 15%; text-align: right;">Of typ aantal:</td>
<td style="width: 18%;"><input name="spyinput" style="width: 150px;" maxlength="8" onkeypress="editspy(this.value,document.forms[spyform].spysearch.value)" onkeydown="editspy(this.value,document.forms[spyform].spysearch.value)" onkeyup="editspy(this.value,document.forms[spyform].spysearch.value)"></td>
<td style="width: 15%; text-align: right;">Zoek op IP<br />of lid:</td>
<td style="width: 18%;"><input name="spysearch" style="width: 150px;" onkeypress="editspy(document.forms[spyform].spyinput.value,this.value)" onkeydown="editspy(document.forms[spyform].spyinput.value,this.value)" onkeyup="editspy(document.forms[spyform].spyinput.value,this.value)"></td>
</tr>
toevoeging op 23 maart 2012, 18:31:42:
Vriendje (Anton)/Ik snappen echt niet waarom het niet werkt.
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
$(#spyrows) = null

Wat klopt, want ik zie geen div / tr met het ID spyrows?
0
Berichten
2.609
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Rik schreef:
$(#spyrows) = null

Wat klopt, want ik zie geen div / tr met het ID spyrows?

Oeps, ja die stond er precies onder:

<div id="spyrows"><div id="error">Er is geen aantal rows opgegeven!</div></div>
toevoeging op 23 maart 2012, 20:37:24:
Maar het werkt nog steeds niet sadley
0
Antonn

Lid · Topicstarter

Berichten
8.649
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
BUMP
0
Berichten
5.897
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
function refreshspy(waarde, nogiets)
{
     $(#spyrows).load("admin/jquery/spy.php?rows="+waarde+"&search="+nogiets).fadeIn("slow");
}
0
Antonn

Lid · Topicstarter

Berichten
8.649
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Maartenl schreef:
function refreshspy(waarde, nogiets)
{
     $(#spyrows).load("admin/jquery/spy.php?rows="+waarde+"&search="+nogiets).fadeIn("slow");
}
Dat kon ik ook nog ns proberen jahh wink
0
Antonn

Lid · Topicstarter

Berichten
8.649
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Werkt ook niet sadley
Het rare i dat de chat in de layout van habbotjes.be het niet doet, maar zonder wel:
Spoiler tonen
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Habbotjes.be ~ Chat</title> 
<link rel="shortcut icon" href="http://www.habbotjes.be/favicon.ico" type="image/x-icon" /> 
    <script type="text/javascript" src="http://www.one2xs.com/includes/jquery.js"></script>
    <script type="text/javascript" src="http://www.one2xs.com/includes/one2xs-js.js?luukisbaas"></script>
    <script type="text/javascript" src="http://www.one2xs.com/includes/jquery-ui.js"></script>
</head>
<body onload="init_chat();">
<script type="text/javascript">

/* COPYRIGHT HABBOTJES */

document.onkeypress = function(evt) {
    evt = evt || window.event;
    var charCode = evt.which || evt.keyCode;
    if (charCode == 13) {
        // Insert Enter handling code here
        postmessage();
    }
};

function init_chat(){

$.get(jquery/chat.php, function(data){

document.getElementById(chat).innerHTML = data;
setTimeout(init_chat(), 1100);

});

}

function postmessage(){

$.post("jquery/chat.php?send", { message: document.getElementById(message_c).value },function(data){
if (data == 2){
alert("Je bericht is te kort.");
}
if(data == 3){
alert("Geen toegang.");
}
     document.getElementById(message_c).value = ;
     document.getElementById(message_c).focus();
     init_chat();
   });
   
}

</script>

<div id="chat"><center><img src="images/lightbox-ico-loading.gif" /></center></div>
<br />
<input type="text" id="message_c" style="width: 513px;" /> <button onclick="postmessage(); document.getElementById(message_c).value = ; document.getElementById(message_c).focus(); init_chat();">Verstuur</button>
</body>
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren