I'm just finishing my first iGoogle gadget, but I have a little
problem:
It consist of 3 tabs with dynamic content. The tabs are working fine;
but I need that each tab change his name depending on his content.

I tried the following:
function doTabs() {
  var tabs = new _IG_Tabs(__MODULE_ID__);
  tabs.addTab("Fixture (Fecha "+FechaURL[0]+")", "tabFix", getFix);
  tabs.addTab((FechaURL[0] != 0) ? "Resultados (Fecha "+
(FechaURL[0]-1)+")" : "Resultados (Fecha -)", "tabRes", getRes);
  tabs.addTab("Posiciones", "tabPos", getPos);
  tabs.alignTabs("left");
};


Then I run this script:
// Fecha actual
function getFecha() {
  var ParamsF = {};
  ParamsF[gadgets.io.RequestParameters.CONTENT_TYPE] =
gadgets.io.ContentType.TEXT;
  var URLf = "http://www.fuialapelota.com.ar/OCAMPO%20A/index.htm";; //
URL a parsear
  gadgets.io.makeRequest(URLf, ResponseF, ParamsF);
};
function ResponseF(obj) {
  RegFecha = /(\d+)(?=\.htm">\s*?<img .*? alt="FIXTURE")/g; // Regex
para el numero de fecha
  Fecha = obj.text; // Guarda el contenido de la URL en Fecha
  FechaURL = Fecha.match(RegFecha); // Guarda el numero de fecha en el
array FechaURL
};
getFecha(); // Ejecuta getFecha para guardar la URL

getFecha works grate, 'cause I use "FechaURL[0]" in other parts of the
script, and they read de value OK. The problem is that the tabs can't.
They show me the following names:
"Fixture (Fecha undefined)"
"Resultados (Fecha NaN)"
In both cases, they should show a number.

I don't know if this is a problem of the order in wich the functions
are executed... But despite of that, what I really need, is a way to
change the tab name from the inside of a function. So, when a function
is executed, the name of the current tab change.

Full script: http://pastebin.com/6Tqgcpmn

Wish have been clear, english is not my native language; so sorry for
that.
Thanks in advance.
azeós.

PS: Please be very clear with the answers, 'cause I'm a noob.
PS2: Sorry again for my english.

-- 
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