cirpo
2007-Jun-11 10:58 UTC
Element referenced by ID/NAME in the global scope. .. can''t solve
hi, i''ve got this warning in the firebug console:
Element referenced by ID/NAME in the global scope. Use W3C standard
document.getElementById() instead.
Everything is working fine in firefox/camino but i have little
problems with IE and i think that the reason is the Warning mentioned
above.
This is what happens.I have a left menu with a list of products , when
i click on a product the right part of the page is update via
Ajax.Updater with the product''s description.
As i said before in Firefox or Camino i haven''t any problems, only the
warning in the firebug console, but in IE if i click the first time
one product everything goes well but if i re-click the same product
listed in the left menu the product''s description is missed(blank
portion) until i click on a different product on the menu.Often
occurs that the "blank portion" persist until i clear the IE cache...
any suggestion?
###########################################################
JAVASCRIPT
###########################################################
var myGlobalHandlers = {
onCreate: function(){
Element.show(''s'');
},
onComplete: function() {
if(Ajax.activeRequestCount == 0){
Element.hide(''s'');
}
}
};
Ajax.Responders.register(myGlobalHandlers);
//ajax call that returns the product description
function get_product(id,lng) ////<- id is the product id , lng is the
lang used for the description
{
var url = "pages/get_product.php";
var pars = ''id='' + id + ''&lng='' + lng;
var get = new Ajax.Updater(''product'',url,{parameters: pars,
method:
''get'',onComplete:light});
}
function light(){ ////<- i have the call this for the visual image
effect
initLightbox();
}
####################################################END
#######################################################
HTML page before calling the ajax update
#######################################################
<html>
<head>
<title>FOO</title>
<meta http-equiv="Content-Type" content="text/html;
charset=UTF-8">
<script src="templates/js/prototype.js"
type="text/javascript"></
script>
<script src="templates/js/scriptaculous.js?load=effects"
type="text/
javascript"></script>
<script type="text/javascript"
src="templates/js/lightbox.js"></
script>
<script src="templates/js/carbonti.js"
type="text/javascript"></
script>
<link href="templates/css/main.css" rel="stylesheet"
type="text/css">
</head>
<body>
<table width="700" height="100%" border="0"
align="center"
cellpadding="0" cellspacing="0">
<tr>
<td id="top"><img src="templates/img/header.jpg"
> </td>
</tr>
<tr>
<td height="243" valign="top">
<div id="flash1" class="flash"></div>
<div id="flash2" class="flash"></div>
</td>
</tr>
<tr>
<td align="center" valign="top">
<table id="main" >
<tr>
<td id="sottomenu">
<table width="100" border="0" cellspacing="0"
cellpadding="0" >
<tr>
<td align="left" valign="top"><a
href="#" id=2
onclick="get_product(this.id,''en'');$(product).update('''');">##<-----
HERE I CALL THE AYAX UPDATER
<td align="left" valign="top"><a
href="#" id=2
onclick="get_product(this.id,''en'');$(product).update('''');">QUICK
RELEASES</a></td>##<----- HERE I CALL THE AYAX UPDATER####
</tr>
</table>
</table>
<table width="100" border="0" cellspacing="0"
cellpadding="0" >
<tr>
<td align="left" valign="top"><a
href="#" id=4
onclick="get_product(this.id,''en'');$(product).update('''');"></a></td>
<td align="left" valign="top"><a
href="#" id=4
onclick="get_product(this.id,''en'');$(product).update('''');">SEATPOST
CLAMP</a></td>
</tr>
</table>
<table width="100" border="0" cellspacing="0"
cellpadding="0"
style="font-size:8pt; padding:5px 0px; line-height:13px;">
<tr>
<td align="left" valign="top"><a
href="#" id=5
onclick="get_product(this.id,''en'');$(product).update('''');"></a></td>
<td align="left" valign="top"><a
href="#" id=5
onclick="get_product(this.id,''en'');$(product).update('''');">SEATPOST
CLAMP carbon</a></td>
</tr>
</table>
</td>
<td id="contenuto"><table width="100%"
cellpadding="0"
cellspacing="0" id="testo">
</table>
<div id="product">############<--- here is the part that has
to be
update#########
<table width="100%" cellpadding="0"
cellspacing="0" id="testo">
<tr>
<td width="15" height="47" rowspan="2"
align="left" valign="top"
background="img/freccia-prodotti.jpg"><img
src="templates/img/freccia-
prodotti.jpg" width="15" height="47"></td>
<td width="62" align="left"
valign="top"><a class="foto-prodotti"
href="#" id="2"
onclick="get_product(this.id,''en'');$
(product).update('''');"><img
src="admin/pages/photos/thumb/
t_carbonti066.jpg" width="60" height="44"
border="0" /></a></td>
<td align="left" valign="top"
style="padding-left:10px;"><span
class="grigio">QUICK RELEASES</span><br>
<a href="#" id="2"
onclick="get_product(this.id,''en'');$
(product).update('''');">details</a></span></td>
</tr>
<tr>
<td height="20" colspan="3" align="left"
valign="top"
background="templates/img/hr-prodotti.jpg"
style="background-repeat:no-
repeat;"></td>
</tr>
</table>
<table width="100%" cellpadding="0"
cellspacing="0" id="testo">
<tr>
<td width="15" height="47" rowspan="2"
align="left" valign="top"
background="img/freccia-prodotti.jpg"><img
src="templates/img/freccia-
prodotti.jpg" width="15" height="47"></td>
<td width="62" align="left"
valign="top"><a class="foto-prodotti"
href="#" id="3"
onclick="get_product(this.id,''en'');$
(product).update('''');"><img
src="admin/pages/photos/thumb/
t_carbonti066.jpg" width="60" height="44"
border="0" /></a></td>
<td align="left" valign="top"
style="padding-left:10px;"><span
class="grigio">QUICK RELEASES FOR MTB WHEELS</span><br>
<a href="#" id="3"
onclick="get_product(this.id,''en'');$
(product).update('''');">details</a></span></td>
</tr>
<tr>
<td height="20" colspan="3" align="left"
valign="top"
background="templates/img/hr-prodotti.jpg"
style="background-repeat:no-
repeat;"></td>
</tr>
</table>
<table width="100%" cellpadding="0"
cellspacing="0" id="testo">
<tr>
<td width="15" height="47" rowspan="2"
align="left" valign="top"
background="img/freccia-prodotti.jpg"><img
src="templates/img/freccia-
prodotti.jpg" width="15" height="47"></td>
<td width="62" align="left"
valign="top"><a class="foto-prodotti"
href="#" id="4"
onclick="get_product(this.id,''en'');$
(product).update('''');"><img
src="admin/pages/photos/thumb/
t_carbonti076.jpg" width="60" height="44"
border="0" /></a></td>
<td align="left" valign="top"
style="padding-left:10px;"><span
class="grigio">SEATPOST CLAMP</span><br>
<span class="rosso">MTB</span><br>
<span class="dettagli">» <a
href="#" id="4"
onclick="get_product(this.id,''en'');$(product).update('''');">details</
a></span></td>
</tr>
<tr>
<td height="20" colspan="3" align="left"
valign="top"
background="templates/img/hr-prodotti.jpg"
style="background-repeat:no-
repeat;"></td>
</tr>
</table>
</div>
<div id="s" style="display:none" align="center"
class="loading"><br><img
src=''templates/img/spinner.gif''><br>LOADING</
div>
</td>
</tr>
</table></td>
</tr>
<tr>
<td id="footer">
<br>
</table>
</body>
</html>
######################################################END
#########################################################
HTML of the update portion
#########################################################
<table width="100%" border="0" cellpadding="10"
cellspacing="0">
<tr>
<td width="13%" align="right" valign="top"
id="testo-
maiuscolo">{name_lang}</td>
<td width="84%" valign="top"
id="testo-minuscolo">{product_name}</td>
</tr>
<tr>
<td align="right" valign="top"
id="testo-maiuscolo">Area</td>
<td valign="top"
id="testo-minuscolo">{product_area}</td>
</tr>
<tr>
<td align="right" valign="top"
id="testo-maiuscolo">{photo_lang}</td>
<td valign="top"><table width="62"
border="0" cellspacing="0"
cellpadding="0">
<tr>
<td><a class="foto-prodotti"
href="admin/pages/photos/photor/
r_{photo}" rel="lightbox"><img
src="admin/pages/photos/thumb/
t_{photo}" border="0" /></a></td>
</tr>
</table>
####################################################END
Sorry for my poor english and SORRY FOR THE BAD HTML, bur i''m not THE
webdesigner involved in this project.
thanks in advance,
cirpo
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---
cirpo
2007-Jun-11 12:01 UTC
Re: Element referenced by ID/NAME in the global scope. .. can''t solve
hi again i solved the Warning problem... i forgot to put the quote in $
(product).update('''');!(feel so stupid).
But the problem with IE persists!
When i re-click on a product in the left menu, nothing appers! i have
to clear the IE temp files...i can''t'' understand why.
Any suggestion?
cirpo
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---
cirpo
2007-Jun-11 12:06 UTC
Re: Element referenced by ID/NAME in the global scope. .. can''t solve
hi again,
i solved the Warning problem... i forgot to put the quote in
$(product).update('''');! (feel so stupid).
But the problem with IE persists!
When i re-click on a product in the left menu, nothing appears ,i have
to clear the IE temp files and cache to make it appears...i
can''t''
understand why.
Any suggestion?
cirpo
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---