[pLog-svn] r4801 - plog/trunk/class/template/smarty/plugins

Oscar Renalias oscar at renalias.net
Wed Feb 21 08:53:35 EST 2007


I was generating a random string that was used in two places: once as
the value of the "id" attribute of the <a> tag and then as the name of
the random object that implements the overlay. This worked fine in
Firefox and Safari but IE kept complaining with some bogus error
message ("Object does not support method or property", or something
like that)

As soon as I used different strings, it all worked again so I figured
I am not allowed to reuse the string... It's confusing to me too, but
perhaps that's the way IE works.

On 2/21/07, Jon Daley <plogworld at jon.limedaley.com> wrote:
>         Is there an extra ) there?
> Also - I am not totally sure what is going on here, but are you setting
> the name to something different than the id, or do you mean two different
> objects having a name/id conflict?
>         I have had some trouble in the past because some
> functions/browsers used the name field and others used the id, so I always
> set both to the same thing.
>
> On Wed, 21 Feb 2007, oscar at devel.lifetype.net wrote:
>
> > Author: oscar
> > Date: 2007-02-21 08:33:33 -0500 (Wed, 21 Feb 2007)
> > New Revision: 4801
> >
> > Modified:
> >   plog/trunk/class/template/smarty/plugins/function.location_display.php
> > Log:
> > Another fix for IE, apparently an object cannot have the same name as a the value of an 'id' attribute of a tag.
> >
> >
> > Modified: plog/trunk/class/template/smarty/plugins/function.location_display.php
> > ===================================================================
> > --- plog/trunk/class/template/smarty/plugins/function.location_display.php    2007-02-21 13:17:32 UTC (rev 4800)
> > +++ plog/trunk/class/template/smarty/plugins/function.location_display.php    2007-02-21 13:33:33 UTC (rev 4801)
> > @@ -31,13 +31,14 @@
> >       isset( $params["height"] ) ? $height = $params["height"] : $height = 390;
> >
> >       // random name for the object, in case we've got more than one per page
> > -     $o = "o_".md5(time);
> > +     $o = "o_".md5(time());
> > +    $oo = "o".$o;
> >
> >       $code = "<script type=\"text/javascript\" src=\"{$baseUrl}/js/yui/yahoo/yahoo-min.js\"></script>";
> >       $code .= "<script type=\"text/javascript\" src=\"{$baseUrl}/js/yui/dom/dom-min.js\"></script>";
> >       $code .= "<script type=\"text/javascript\" src=\"{$baseUrl}/js/yui/event/event-min.js\"></script>";
> >       $code .= "<a id=\"$o\" href=\"javascript:void(0);\">".$location->getDescription()."</a>";
> > -     $code .= "<script type=\"text/javascript\">$o=new Lifetype.UI.Overlay({url:'".$indexUrl."?op=locationDisplay&width=".$width."&height=".$height."&locId=".$location->getId()."',width:".$width.",height:".$height.",context:'$o',showCloseButton:true});</script>";
> > +     $code .= "<script type=\"text/javascript\">$oo=new Lifetype.UI.Overlay({url:'".$indexUrl."?op=locationDisplay&width=".$width."&height=".$height."&locId=".$location->getId()."',width:".$width.",height:".$height.",context:'$o',showCloseButton:true});</script>";
> >
> >       return( $code );
> > }
> >
> > _______________________________________________
> > pLog-svn mailing list
> > pLog-svn at devel.lifetype.net
> > http://limedaley.com/mailman/listinfo/plog-svn
> >
>
> --
> Jon Daley
> http://jon.limedaley.com/
>
> A professor is one who can speak on any subject: for precisely fifty minutes.
> -- Norbert Weiner
> _______________________________________________
> pLog-svn mailing list
> pLog-svn at devel.lifetype.net
> http://limedaley.com/mailman/listinfo/plog-svn
>


More information about the pLog-svn mailing list