473,385 Members | 1,445 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

3 dimensional array assigned to smarty pass to javascript

In my program I want to use a 3 dimensional array to read out and compare the url data. That doesn't matter, but the main thing is, i pass a 3 dimensional array to a template as {test} so it has the following array structure a numeric array, where i pot a associative array in, and there inside is a another numeric array.

$test[0]['name'][0]

Now I want to use javascript to read out the length of the different array's and also the variables but since I cant get it work, can someone help my please? i ll be greatfull
Mar 8 '12 #1
1 2227
dlite922
1,584 Expert 1GB
Because of smarty's default curly bracket ({}) tags, you need to use the smarty {literal} tag to echo out your variable value to a javascript one. Remember javaScript is client side, server does not execute it like smarty and php, the user's computer browser executes it.

You can also print it out to a hidden field and read it using javascript. document.getElementById('hiddenFieldsID').value. or using jquery: $('#hiddenFieldID').val()

Good luck,

Dan
Mar 16 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: smurf | last post by:
Seems a simple question, but I can't find a simple answer: I have created a two dimensional array. I wish to send the data, a row at a time to a graph plotting routine which is expected a one...
1
by: Sam | last post by:
Hello all I have a two dimensional array (the dimensions are not known) that needs to be passed to fortran from c++, allocate the dimensions of the array in fortran code, do some filling up of...
18
by: bsder | last post by:
Hi, Can anyone please tell me how to calculate the size of the following 4-dimensional array, and now to use qsort for sorting on this array? double sp = { 4.0, 5.0, 6.0 }; double spa = { {...
3
by: questions? | last post by:
I tried to pass a two dimensional array in the function arguments the following program is a demonstration, ******************************************** # include <stdio.h> # include...
5
by: Richard Lewis Haggard | last post by:
I am trying to create multi-dimensioned arrays in conventional ASP pages and pass these arrays as arguments to functions that are in a C# interop assembly. ASP complains because it doesn't...
6
by: fniles | last post by:
I need to store information in a 2 dimensional array. I understand ArrayList only works for a single dimensional array, is that correct ? So, I use the 2 dimensional array like in VB6. I pass the...
8
by: per9000 | last post by:
Hi all, I have a two-dimensional array of data, f.x int's. We can imagine that the array is "really large". Now I want the data in it and store this in a one-dimensional array. The obvious...
3
by: karmenkrile | last post by:
In html i have some question, and the answers are radio buttons ... the names of variables in html are array ... like question, question ... etc. and every question has multiple value, depending...
29
by: Why Tea | last post by:
Suppose you have a 2-dimensional array (matrix) in main() and you want to pass it to a function to do some processing, you usually pass it as a pointer to the first element. But, from the function,...
6
by: johntology | last post by:
Hello, I've made a two dimensional array using references, which I gather is the only way to do it in Perl. I now need to pass each interior array to a subroutine for processing and can't quite...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.