Share » Forums » Developer » how to insert images using javascript

how to insert images using javascript

how to insert images using javascript

Wednesday 09 June 2004 9:02:23 am - 6 replies

Modified on Wednesday 09 June 2004 9:27:29 am by Balaji Ramachandran

Author Message

Paul Forsyth

Wednesday 09 June 2004 10:00:43 am

I see you are using literals. You need to use the 'literal' tag more often, for example:

 cTemp = cTemp + "<TD><IMG SRC=" {/literal}{myImg_03.jpg|ezimage}{literal} WIDTH=155 HEIGHT=107></TD>";

I hope you see what im doing here.

paul

--
http://www.visionwt.com

Ekkehard Dörre

Wednesday 09 June 2004 12:01:46 pm

More info:
http://ez.no/ez_publish/documentation/customization/tips_tricks/javascript_in_templates

Greetings, ekke

http://www.coolscreen.de - Over 40 years of certified eZ Publish know-how: http://www.cjw-network.com
CJW Newsletter: http://projects.ez.no/cjw_newsletter - http://cjw-network.com/en/ez-publ...w-newsletter-multi-channel-marketing

Trond Åge Kvalø

Thursday 10 June 2004 1:29:56 am

Hi Balaji!

As you say the myImg variable is "/images/". I therefore presume that the images are called _03.jpg, _04.jpg and so on, right?

Then you would use Paul's method and write:

<SCRIPT LANGUAGE="JavaScript" type="text/javascript">
{literal}

function fnBuildTopMenu(cIn)
{
var myImg="/images/";
var cTemp = "";
cTemp = cTemp + "<TD><IMG SRC="{/literal} {_03.jpg|ezimage} {literal}WIDTH=155 HEIGHT=107></TD>";
cTemp = cTemp + "<TD><IMG SRC="{/literal} {_04.jpg|ezimage} {literal}WIDTH=155 HEIGHT=107></TD>";

and so on.

Paul's post had a minor glitch since he used myImg_03.jpg instead of _03.jpg

Hope this helps
trondåge

trondåge

Paul Forsyth

Thursday 10 June 2004 1:37:27 am

Yip, thanks :) My bad cut and paste.

paul

--
http://www.visionwt.com

Jorn smith

Monday 01 December 2008 6:39:20 pm

when i search "insert images using javascript", i came here, but my question is how to put a image above another one with js and css. tks

http://www.sales-battery.com

zillion liu

Tuesday 10 February 2009 8:20:42 pm

The "{literal}" is a function library?
please tell me how to use it.

-------------------------------------------------
http://www.canon-digital-camera-battery.co.uk/batteries/canon-bp-511.htm

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu