Why not put the image in a div with style="display:none" and then show it
based on the response?  

-----Original Message-----
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
Behalf Of Ricardo
Sent: Thursday, August 27, 2009 2:52 PM
To: jQuery (English)
Subject: [jQuery] Re: Image inside script


$("."+errId).empty()
   .css({ display: inline, color: 'red' })
   .text(" Invalid Character. Numerals only.")
   .prepend('<img src="x" />');

What CMS are you using? The page is probably in the root of your
website, so you'll need the full path to the the image.

On Aug 27, 3:02 am, Fabio <fabioisc...@gmail.com> wrote:
> Hi Paolo ,
>
> I Tried perpending
>
> like this
>
>         var errImg = '/img/errIcon.gif';
>
>         $("."+errId).attr("style","display: inline; color: red");$
> ("."+errId).prepend('<img src="' + errImg + '"/>&nbsp;&nbsp;');$
> ("."+errId).html('&nbsp;Invalid Character. Numerals only.');}
>
> which should have worked like a magic.. but unfortuneltly  something
> is causing the image not to render ... could u please help me figure
> out the issue
>
> the image is placed under the web content/themes/img/errorIcon.gif
>
> Thanks
> Fabio
>
> '<img src="' + errImg + '"/>&nbsp;&nbsp;'
> On Aug 27, 10:05 am, Fabio <fabioisc...@gmail.com> wrote:
>
> > Hi Paolo ,
>
> > I tried doing this
>
> >         {$("."+errId).attr("style","display: inline; color: red");$
> > ("."+errId).html("<img src="+contextpath+"/theme/img/errorIcon.gif/
>
> > >&nbsp;Invalid Character. Numerals only.");}
>
> > since the image is not picking up from the /img/ folder .... i am
> > trying to access with a help of the context path .Or is there a work
> > around for this .
>
> > early reply would be appreciated.
>
> > Thanks
> > Fabio
>
> > On Aug 26, 11:29 pm, Paolo Chiodi <chiod...@gmail.com> wrote:
>
> > > $("."+errId).prepend('<img .... />');
>
> > > On Wed, Aug 26, 2009 at 5:45 AM, Fabio<fabioisc...@gmail.com> wrote:
> > > > $("."+errId)

Reply via email to