Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Ajax script takes long
Old 01-13-2010, 05:52 AM Ajax script takes long
Experienced Talker

Posts: 48
Name: Pieter
Location: Holland
Trades: 0
This is the same ajax script I always use, but for some reason it takes 5 minutes before it calls the data.
After five minutes the requist starts and is don in a sec.

Here's the code :

PHP Code:
<?php
 
include("files/checklogin.php");
 
$query mysql_query("SELECT * FROM `probleemtypen`");
 
$rows mysql_num_rows($query);
?>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 
 <head>
  <title>
   ICT HELPDESK | van den Udenhout Groep
  </title>
  <link rel="stylesheet" type="text/css" href="../style/main.css" />
 
<script lang="javascript">
<!--
//ajax requist script voor selectie vlakken
var xmlhttp
//Oproepen gegevens voor subtype
function loadSub(str)
{
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
  {
  alert ("Your browser does not support AJAX!");
  return;
  }
var url="files/select_subtype_option.php";
url=url+"?q="+str;
url=url+"&sid="+Math.random();
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
}
function stateChanged()
{
if (xmlhttp.readyState==4)
  {
  document.getElementById("subDiv").innerHTML=xmlhttp.responseText;
  }
}
//
function GetXmlHttpObject()
{
if (window.XMLHttpRequest)
  {
  return new XMLHttpRequest();
  }
if (window.ActiveXObject)
  {
  return new ActiveXObject("Microsoft.XMLHTTP");
  }
return null;
}
-->
</script>
  <meta http-equiv="Content-type" content="text/html;charset=UTF-8" />   
 </head>
 <body>
  <div id="wrapper">
 
   <div id="header"><!--Header div-->
    <img src="../style/images/udenhout_logo.gif" alt="logo" height="55" style="float: left;" />
    <div height="70">
     <h3 style="float: right;">Probleem Toevoegen<br />
      <div id="link" width="100%" height="25" align="right" >
       <a class="link_index" href="index.php">INDEX</a>
      </div>
     </h3>
    </div>
   </div>
 
   <div id="page">   
    <div width="100%" align="center">
     <table align="center">
      <tr>
       <form action="" method="POST">
        <td><b>Probleemtype</b></td> 
        <td>
         <select name="probleem" style="width:200px;" onchange="loadSub(this.value)">
          <option value=""></option>
<?php
 
for($i 0$i $rows$i++)
 {
  
$probleem mysql_fetch_object($query);
?>
          <option value="<?php echo"$probleem->probleem"?>"><?php echo"$probleem->probleem";?></option>
<?php
 
}
?>
         </select>
        </td>
       </form>
      </tr>
      <tr>
     <div id="subDiv" align="center">
     </div>
    </div>
   </div>
  </div>
 </body>
</html>

Thanx
elcosmo is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 01-13-2010, 05:55 AM Re: Ajax script takes long
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,383
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Probably waiting for the server to respond.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 01-13-2010, 05:59 AM Re: Ajax script takes long
Experienced Talker

Posts: 48
Name: Pieter
Location: Holland
Trades: 0
how can this be changed, because this is the only page that has this problem.
Evry other page does this in a second,?
elcosmo is offline
Reply With Quote
View Public Profile
 
Old 01-13-2010, 06:07 AM Re: Ajax script takes long
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,383
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Haven't got a clue.

No idea what it is even supposed to do.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to Ajax script takes long
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.22280 seconds with 12 queries