javascript needs text field on one line

Author Message

Felix Laate

Friday 08 April 2005 6:53:09 am

Hi all!

I'm fetching som text from a class and I want it to be the string of a variable in a javascript function.

Only problem is that javascript wants the string to be on one line.

Is there a operator that can achieve this? Or is there another way?

Felix

Publlic Relations Manager
Greater Stavanger
www.greaterstavanger.com

Łukasz Serwatka

Monday 11 April 2005 6:08:26 am

Hi Felix,

Could you paste your code example here?

Personal website -> http://serwatka.net
Blog (about eZ Publish) -> http://serwatka.net/blog

Felix Laate

Monday 11 April 2005 6:14:33 am

Hi Luke!

As I found no answer to this question, I decided to first put the content into seperate spans, and then switch the content of the div with that of the desired span. This works great, but gives me a set with extra spans (which are hidden of course).

Anyways: the code of my original plan is this:

<script type="text/javascript">
<!--
// Endre tekst på branner
var allFires= new Array(2000);

{section name=Fire loop=$branner}					
{*$Fire:item.data_map|attribute(show)*}

allFires[{$Fire:item.data_map.year.content}] = "<strong>{$Fire:item.data_map.title.content}</strong><p>{$Fire:item.data_map.description.data_text|break}</p>";
{/section}
{literal}

function changeText(year) {
  document.all.branntekst.innerHTML = allFires[year];
}

{/literal}
//-->
</script>

Would be great if it was doable!

Felix

Publlic Relations Manager
Greater Stavanger
www.greaterstavanger.com

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 31 2025 03:39:47
Script start
Timing: Jan 31 2025 03:39:47
Module start 'layout'
Timing: Jan 31 2025 03:39:47
Module start 'content'
Timing: Jan 31 2025 03:39:47
Module end 'content'
Timing: Jan 31 2025 03:39:47
Script end

Main resources:

Total runtime0.0207 sec
Peak memory usage4,096.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0046 588.2500151.2266
Module start 'layout' 0.00460.0032 739.4766220.7188
Module start 'content' 0.00780.0115 960.1953997.8359
Module end 'content' 0.01930.0014 1,958.031333.9922
Script end 0.0207  1,992.0234 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002311.1755140.0002
Check MTime0.00104.8600140.0001
Mysql Total
Database connection0.00073.245810.0007
Mysqli_queries0.002210.759830.0007
Looping result0.00000.053010.0000
Template Total0.00104.710.0010
Template load0.00073.549810.0007
Template processing0.00021.111110.0002
Override
Cache load0.00052.476710.0005
General
dbfile0.00031.293080.0000
String conversion0.00000.028840.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs