this is the simple test gadget.

<?xml version="1.0" encoding="utf-8"?>
<Module>
  <ModulePrefs title="__MSG_title__" height="280" width="350">
    <Require feature="dynamic-height"/>

  </ModulePrefs>
  <Content type="html">
    <![CDATA[

<div id="general">
<div id="contenu1">
</div>
<input type="button" onclick="testrequest()" value="send request"/>
</div>

<script type="text/javascript">
function testrequest()
{
  var url = "http://hari.b-holding.be/Hari2/bin/query.exe/fn?
REQ0JourneyStopsS0A=1&REQ0JourneyStopsS0G=tournai";
  url +=
"&REQ0JourneyStopsZ0A=1&REQ0JourneyStopsZ0G=leuze&REQ0JourneyDate=10.5.2009&REQ0JourneyTime=10:15";
  url +=
"&Timesel=arrive&ViaName=&ViaMode=NEE&DateMode=ANDERS&PLANNER=True&start=1&queryPageDisplayed=yes";
  url = encodeURI(url);
  alert(url);
  _IG_FetchContent(url, treat_test);
}
function treat_test(test)
{
  document.getElementById("contenu1").innerHTML = test;
  _IG_AdjustIFrameHeight();
}
</script>

it always works the first time.

this is the function of my gadget that constructs my url and send the
request.

function geturl()
{
    var jj = document.getElementById('TravelDay').value;
    var mm = document.getElementById('TravelMonth').value;
    var aaaa = document.getElementById('TravelYear').value;

    //========================================================
    //si origine et destination fournies et si date est valide
    //========================================================
    if(document.getElementById('S').value != '' &&
document.getElementById('Z').value != '' && verifdate(jj,mm,aaaa))
    {
        //=============================
        //effacement des avertissements
        //=============================

        document.getElementById('labdateerror').style.display =
"none";
        document.getElementById('S').style.backgroundColor = 'white';
        document.getElementById('Z').style.backgroundColor = 'white';

        //=====================
        //construction de l'url
        //=====================

        url= "http://hari.b-holding.be/Hari4/bin/query.exe/__MSG_url__?
REQ0JourneyStopsS0A=";
        s = document.getElementById("Stype").value;
        url += s;
        if(document.getElementById("S").value != "")
        {
                  url += "&REQ0JourneyStopsS0G=" + document.getElementById
("S").value;
        }
        z = document.getElementById("Ztype").value;
        url += "&REQ0JourneyStopsZ0A=" + z;
        if(document.getElementById("Z").value != "")
        {
          url += "&REQ0JourneyStopsZ0G=" + document.getElementById
("Z").value;
        }
        var jj = document.getElementById('TravelDay').value;
        var mm = document.getElementById('TravelMonth').value;
        var aaaa = document.getElementById('TravelYear').value;
        var date = jj + "." + mm + "." + aaaa;
        url += "&REQ0JourneyDate=" + date;
        var hour = document.getElementById('TravelHours').value + ":"
+ document.getElementById('TravelMinutes').value;
        url += "&REQ0JourneyTime=" + hour;
        if(document.getElementsByName('Datemodee')[0].checked == true)
        {
          var hourtype = type = "depart";
          document.getElementById('timesele').value = "depart";
        }
        else
        {
          var hourtype = type = "arrive";
          document.getElementById('timesele').value = "arrive";
        }
        url += "&Timesel=" + hourtype;
        if(modif == true)
        {
          prod = document.getElementById('Transtype2').options
[document.getElementById('Transtype2').selectedIndex].value;
        }
        url +=
"&ViaName=&ViaMode=NEE&DateMode=ANDERS&PLANNER=True&start=1&queryPageDisplayed=yes";
        url = encodeURI(url);
        modif = false;

        //=======================
        //lancement de la requête
        //=======================

        _IG_FetchContent(url, treat_response);
    }

it works very rarely before the third time.

thanks.


On 14 mai, 01:41, abowman <[email protected]> wrote:
> Replicate the problem in a simple test gadget and then show us the
> code.
>
> On May 13, 11:24 am, furby <[email protected]> wrote:
>
> > I wonder if it might have something to do with where the request is
> > coming from... Could there be a difference between the Windows Live
> > platform and the Google platform that the server side is seeing 2 out
> > of every three times?
>
> > It really doesn't sound like a problem with the gadget per se (I'm far
> > from an expert on this though, so somebody else might see the
> > problem)...
>
> > On May 13, 2:33 am, djmic <[email protected]> wrote:
>
> > > weird...since I created the same widget platform for Windows Live home
> > > and I do not worry.
>
> > > On May 12, 5:15 pm, Timothy Collins <[email protected]> wrote:
>
> > > > Weird... it seems that the first two are encountering an error 
> > > > somewhere on
> > > > the server side... OR you have something going on with the firewall on 
> > > > your
> > > > network that is causing the first two to fall off into nothingness.
>
> > > > Let me think on this...
>
> > > > On Tue, May 12, 2009 at 10:52 AM, djmic <[email protected]> wrote:
>
> > > > > Firebug displays two empty answer for the first and second request but
> > > > > my callback() function is not called.
>
> > > > > times:
> > > > > first request : 56 ms
> > > > > second request : 58 ms
> > > > > last request : 411 ms
>
> > > > > thanks
>
> > > > > On May 12, 1:44 pm, Timothy Collins <[email protected]> wrote:
> > > > > > It almost sounds like the server side of this might have a problem 
> > > > > > or be
> > > > > a
> > > > > > bit slow... the first two times you send it : do you get anything 
> > > > > > back?
> > > > > An
> > > > > > error or anything at all? Or does the request just disappear down a 
> > > > > > black
> > > > > > hole?
>
> > > > > > On Tue, May 12, 2009 at 7:41 AM, abowman <[email protected]> wrote:
>
> > > > > > > It would help if you showed us your code.
>
> > > > > > > On May 12, 6:05 am, djmic <[email protected]> wrote:
> > > > > > > > Hi all,
>
> > > > > > > > I have a problem with the _IG_FetchContent() function.
>
> > > > > > > > I have to send the request three times to receive a response.
>
> > > > > > > > I receive no response the first time and the second time.
>
> > > > > > > > What's the problem.
>
> > > > > > > > Thanks- Hide quoted text -
>
> > > > > > - Show quoted text -- Hide quoted text -
>
> > > > - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"iGoogle Developer Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Gadgets-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to