Javascript array

I am trying to create a page where the user can click on a
thumbnail image and it will come up in the larger photo area so
that they can see a larger version of the image. I have created
some javascript but am not sure if I need to add splashCaption
splashImage Arrays in order for it to work. I also want to have the
text linked to each array. I want to do this so that I don't have
to create seperate pages for each large photo
(ie...ipug_green.html, ipug_red.html, etc).
Here is what the page (ipug.html) looks like:
http://homepage.mac.com/coasterlisa/daisys_corner/ipug.html.
The javascript isn't working probably because the arrays aren't
coded in and the text needs something different (behaviors?)added
to it.
Any help would be appreciated.
Note: I realize from reading the book I was writing the
scripting from (DW MX 2004 - Grannell/Powers/McLachlan) that some
browsers and users won't have access to this script format. So, I
was wondering if there was another way where the user can click on
a thumbnail and see the larger image color without starting at the
top of each page. I tried anchor tags and got a little confused
working with seperate HTML pages (ipug2.html, ipug3.html,
ipug4.html, etc). I am also using DW 8 so I'm sure if this
scripting code is still workable.

Please show us a link to the page or at least post the code.
"CoasterLisa" <[email protected]> wrote in
message
news:er880v$crq$[email protected]..
>I am trying to create a page where the user can click on
a thumbnail image
>and
> it will come up in the larger photo area so that they
can see a larger
> version
> of the image. I have created some javascript but am not
sure if I need to
> add
> splashCaption splashImage Arrays in order for it to
work. I also want to
> have
> the text linked to each array. I want to do this so that
I don't have to
> create
> seperate pages for each large photo
(ie...ipug_green.html, ipug_red.html,
> etc).
>
> Here is what the page (ipug.html) looks like. The
javascript isn't working
> probably because the arrays aren't coded in and the text
needs something
> different added to it.
>
> Any help would be appreciated.
>
> Note: I realize from reading the book I was writing the
scripting from (DW
> MX
> 2004 - Grannell/Powers/McLachlan) that some browsers and
users won't have
> access to this script format. So, I was wondering if
there was another way
> where the user can click on a thumbnail and see the
larger image color
> without
> starting at the top of each page. I tried anchor tags
and got a little
> confused
> working with seperate HTML pages (ipug2.html,
ipug3.html, ipug4.html,
> etc). I
> am also using DW 8 so I'm sure if this scripting code is
still workable.
>

Similar Messages

  • Adobe Acrobat 9: Javascript array populated combo box - Selected answer will not save

    I have a combo box on one of my forms that is populated using a Javascript array.  The combo box is populating just fine, but when an item is selected from that combo box, the selected item does not save when the user saves the document.  Any suggestions as to what the problem is and how it can be corrected?  I am a loss as to where to even begin looking.  Any help is greatly appreciated.
    Thank you.
    Lisa

    You might also want to check the Scripting forum
    http://forums.adobe.com/community/acrobat/acrobat_scripting

  • How to pass java arraylist into javascript arrays

    Hi, i have declare an arraylist
    ArrayList list1 = new ArrayList();Inside the arraylist, there are elements. Now, i wan to pass the elements in the java arraylist into javascript arrays but i encounter javascript errors.
    This is how i code.
    var arr1 = new Array();
    <%
    for ( int x =0; x<list1.size(); x++)
    %>
         arr1[<%=x%>] = <%=(String)list1.get(x)%>;
    <%
    %>how do i solve this problem?
    Thanks for the guidance in advance

    JTech wrote:
    Hi,
    Use Quotes around string value ( arr1[indexposition] = "stringvalue";), when assign to javascript array as below.
    arr1[<%=x%>] = "<%=(String)list1.get(x)%>"; Regards,
    Ram.Hi Ram,
    How about using arr1 = <%=list.toArray()%> ??? Is this possible? I tried it but was not working on my IDE. Do you have any solutions for this??
    Regards,
    Thiagu

  • Populating a javascript array with datatable data

    I want to populate a javascript array with datatable data.
    How do I do this?
    I want the javascript array to be populated as the datatable is displayed.
    Doing this way doesn't work.
    <h:dataTable value="#{pmManager.profiles}" var="pmProfile" binding="#{pmManagerUiBean.uiTable}" ">
    <script>
    allProfilenames[index]='#{pmProfile.profileName}';
              alert("index ="+index);
              alert("...1"+allProfilenames[0]);
              alert("...2"+allProfileRes[0]);
              index++;
    </script>
    <h:dataTable>

    In Javascript do something like this:
    document.getElementById('form1:dec_param');
    where form1:dec_param is the id of the component on the page source (html)

  • Getting pcs:foreach to iterate a Javascript array

    Dear Experts,
    I've got a selection list in a content item, and I can happily use <pcs:foreach> to iterate over it.
    So now, I would like to add an additional item to that which the user has selected, or get rid of some of the items.
    I have been able to get the values that I want intop a javascript array, but <pcs:foreach> to iterate. I have tried a delimited string with both a spaces and commas, no luck.
    Any ideas on programatically editing a selection list, or getting <pcs:foreach> to deal with an array?
    Thanks!
    Rob
    PS Here's the code !
    <script>
    var NewsCategoriesToShow = myArray.split(',');
    </script>
    This fails: <pcs:foreach var="cat" expr="NewsCategoriesToShow">
    This also fails: <pcs:foreach var="cat" expr="myArray">
    Only this works: <pcs:foreach var="cat" expr="mySelectionList">
    ...

    have you tried using straight javascript or jquery to edit the selection list after it is built? like with some javascript at the bottom of the page? i'll see if i can dig up any old code to see if i find that i've done this before.

  • Assigning javascript array with jsp array

    hi,
    I have a jsp page where I have a array in jsp. I want to assign the values to an javascipt array. how can I do that?
    the reason why I want to do this is for a perticular problem I am facing in javascript. that is....
    I have a text box in my jsp page, I want the value entered in that box to be checked (whether it exists ) against a hidden string which has some value. I want that hidden string not to be shown to the user even on seeing the html source. that is why I want these values to be stored and checked against a array object of javascript.
    any suggestion is appreciated
    Thanks
    Ashutosh

    Hai asutoshdash
    if you dont mind of viewing code u can use this else dont use, its not matters weatehr user will see you code or not if the user is professiona then its a big issue normal users not think of is for this dont send valuable infos like password etc to client u may send usernames
    ok to create a java array to javascript array do this (i took example of db to array ) write this inside <script> <%codes here%> </script>
    var aUsername =new array();
    <%
    int i=0;
    while (rs.next())
    %>
    aUsername[<%= ++i%>] = "<%= rs.getString("User_Name")%>";
    <%
    %>thats it use this array where ever you want in your client side(javascript ) usage
    hope this will help you
    archi

  • Load CF varibales into javascript array without outputing to source code

    I have a javascript array for dynamic dropdowns - Automobile, makes,models, etc.
    The javascript arrays are populated by by cf queries
    Everythign works and functions fine - but it also loads the entire array (hundreds of lines of code) into the browser source code.
    I would like to have the javascript arrays hidden from the browser source code by calling it:
    <script language="JavaScript" type='text/javascript' src='../js/super.js'></script>
    But when I code like this, the js file 'super.js' does not run the cf variables.
    The only way I can get it to function right now is to save a cf file called 'super.cfm' and have it run the cf query, then list the javascript code under the query on this cf template.
    THis works - but again, it causes the entire javascript code to be visible to the browser source code...
    any ideas? - I am on cf 7
    thanks in advance

    thanks for your idea
    I ended up rethinking the whole process and realized that I only update my vehicle make/model list about once a week
    So what I ended up doing was creating the the dynamic javascript arrays through cf - and rendered them in a browser, then took the browser source code (the fully rendered javascript arrays) and saved them as a static js file
    My website uses this js file on every page, so I no longer need to call queries on every single page to populate the javascript arrays - they are already built and I am guessing cached by the browser  (browsers cache js files right?)
    SO this runs more efficiently.
    The only draw back is that when I add a new vehicle to the list in my database, I will need to manually do the same process of rendering the new js code, then cutting and pasting it into my static js file that gets called by all pages.
    So it loses the realtime updates - but this only happened once a week anyway - and it only takes me five minutes to create the new file.
    We'll see if I get sick of manually creating a new js file each week - probably, but this seems better than making the server re-render the code on each page.
    Does this make sense? - would this be less overhead on the server than implimenting your concept?
    thanks.

  • Java Vector to Javascript Array

    Hi all, im facing a potential problem and would be very grateful for any help on the following
    I want a Vector (rather several Vectors) comprising of serializable plain old java objects. I will have a JSP or plain HTML (probably JSP) page containing, amongst other things, a javascript array or set of arrays i want to have populated with the contents of the vectors . . .
    Is this possible? not after code really just a feasible way of implementing this . . .it mi9ght turn out that it cann all be done via JSP / Java.
    P.S. Asan after thought, when writing this,anyone know where i can find information regarding java accessing manipulating HTML DOM please
    Thanks in advance for the help people.

    Cool Thanks for your replies. At least i know that it cant be done i wont look for anything on HTML DOM .....
    I dont believe i didnt see that method of implementation for the vector problem it seems so straight forward .. thats what I get for being a newb at both JSP and Javascript :)
    Thanks again gus much appreciated

  • Jsp variables to javascript array, for loop dont work.

    This works fine. con.getmake passes a different variable each time to the javascript array using a manual index.
    <script>
    make[0] = "<%= con.getmake() %>" ;
    document.write(make[0]);
    make[1] = "<%= con.getmake() %>" ;
    document.write(make[1]);
    make[2] = "<%= con.getmake() %>" ;
    document.write(make[2]);
    make[3] = "<%= con.getmake() %>" ;
    document.write(make[3]);
    </script>
    If I try and do the same with a for loop, It seems as though all the elements hold the same first variable retrieved from con.getmake, I am not getting the next variable from my java class.
    <script>
    for (var i= 0; i <= 2; i++)
    make[i] = "<%= con.getmake() %>" ;
    document.write(make);
    </script>

    Hi,
    Java is parsed once on the server which creates a HTML page, then it is passed to the client's browser where the javascript is executed. So con.getmake() is only executed once in java. You've got to execute your loop in java not javascript :
    <script>
    <%
    for (int i= 0; i <= 2; i++)
    %>
    document.write("<%= con.getmake() %>");
    <%
    %>
    </script>

  • Javascript array for iGrid & iCharts

    Is there a way to push javascript array data to IGrid and iChart display templates?

    The runtime java applets only 'pull' data by executing the underlying query template, so there is no way for you to directly 'push' data from a JavaScript array into them.
    An indirect way to accomplish this would be to pass the contents of your array as a comma separated list into a query parameter (Param.x) as an IN clause in a SQL Query template or through an Xacute Query to a BLS transaction, where you could process the list as desired and return the dataset to the applet.  Not a very direct approach, but a possibility.
    Regards,
    Jeremy

  • How to fill a javascript array by a jsp array when the jsp is run

    Hi all,
    The problem i am facing is -- i want to use an javascript array in a function. The records are being fetched by jsp.
    How to fill the vaules in a javascript array, which are retrieved by a jsp array
    Please suggest
    Thanking You

    You can use the code below:
    <input type="button" value="Click Me" onclick="javascript:disp('<%= getString(str) %>')">
    <%!
    public String getString(String str[]){
    String arrElements="";
    for(int i=0;i<str.length;i++) {
    arrElements+=str[i]+",";
    return arrElements.substring(0,arrElements.length()-1);
    %>
    function disp(str) {
    arr = str.split(",");
    alert ("There are "+arr.length+" elements in the array");
    Hope this helps.

  • Storing data from resultset to javascript array

    Hi all,
    Can anyone let me know how to store data from servlet's result set to javascript array ?
    Firstly i have downloaded all the data at client side in the resultset while the servlet form
    is first loaded...then i want to use javascript array to check that whether the code entered by
    the user on runtime exists in resultset or not.
    If the code doesnot exist the user will be prompted to enter another code by alert.
    and if the specified code exists then the name of the respective client will be displayed in
    text box on the servlet form.
    For this reason i want to use javascript for code validation.
    Thanks for any help in advance.
    sunny.v

    Just let JSP print it as JS array.

  • Convert javascript array to java array

    Is there any way possible to convert javascript array to java array?

    if you will try to experiment a javascript array
    putting it to a hidden element, it will be converted
    to a string (comma delimited). You can get the value
    of that element as a string and use StringTokenizer
    class to put the values into a java arrayThanks, got it.

  • Stalling a form from loading until the initial javascript arrays are loaded

    I am looking for a way to get a form to be hidden based on the onload event. I would like to call a javascript function to initially populate some select boxes based on javascript arrays, but I would like this to happen before the page loads or at least stall displaying the select boxes until they are populated.
    The way it is setup now, when the page loads, the select boxes try to load first and then the rest of the form loads. I would like to know if there is a way to load the select boxes from the javascript arrays, then have the select boxes and other form elements show up at the same time. I have tried putting a <div> around the entire form and within the javascript populate function I first use "document.formname.div_id.style.visibility=hidden" then at the end of the select box population within the function, I use "document.formname.div_id.style.visiblity=visible". I tried this and the select boxes appear blank; it is as if the populate function doesn't work at all.
    I realize this is a very long question, but I will award you Duke Dollars if you help me out!!!

    right now, I have it set up where I click on a link which is a jsp page which forwards me to the jsp page that has all the html in it. That page is where I initially try to populate the select boxes with the javscript arrays...I also have a number of javascript functions which change the contents of the select boxes based on another select box in the form. Will i have access to those "java" arrays, [instead of using the javascript arrays], that you are suggesting in the javascript code? I do need to use whatever arrays I create in javascript functions.

  • Pass javascript array to java

    hii
    I have to pass a javascript array to my java MyAction.do . So how can i do it???
    Thnking You

    Being a Java newbie, I can't give you a definitive on how to pass the array to a client-side applet, although it should be possible.
    As for passing it to something server-side there are only a couple ways: in a GET request on the query string or in a POST. No matter what, you will have to flatten the array with some method or other, to convert it into a text string that can be parsed on the other end.
    I personally favor using hidden form elements and posting the data, because otherwise you have to worry about urlencoding your query string. You could just use javascript itself to write a series of hidden text inputs and then submit the form, so all your form handler has to do is pick up the variables.
    Let's say the array is named "myarray":
    Code:
    +<script language="Javascript">+
    document.writeln("<form name=\"myform\" method=\"POST\" action=\"myserver/myhandler.jsp\">")
    for(i = 0; i < myarray.length; i+){+
    document.writeln("<input type=\"hidden\" name=\"myarray[" i + "]\" value=\"" + myarray[i] + "\">")+
    +}+
    +document.writeln("</form>")+
    +document.myform.submit()+
    +</script>+
    I know this is clunky and "low-tech" but it will work, and has the benefit of working for any server-side platform that can handle forms

  • Unpack javascript array to cfarray

    Hi everybody,
    From a captivate quiz movie I want besides the Core Data,
    also the interaction data.
    From each action in a quiz I read out the InteractionID,
    ObjectiveID and Result and store them in 3 javascript arrays.
    One array at the moment takes 36 values. The arrays are sent
    as hidden files to a form and in the next step are stored in a
    database at the Cfserver. However, the javascript array is not
    unpacked. This means that all values form the array are stored as a
    single record value. 1 field takes 36 values. Whereas I want the
    values to be stored as 36 different record values.
    So, my question is: how do I unpack a javascript array to a
    coldfusion array and store all values as different record values to
    a database.

    When a Javascript array gets passed as a form value, it gets
    compressed into a 1-dimensional text string. This is the nature of
    web forms. As you've seen, when the data arrives at it's final
    destination, you then need to split the string back into an array.
    I don't actually know ColdFusion, but a quick web search
    indicates that you want the ListToArray() function. This is
    documented at the following link:
    ColdFusion
    Live Docs: ListToArray
    If I remember correctly, Javascript joins array elements
    using a comma, so you shouldn't need to specify a string delimiter.
    If that's not correct, take a look at your passed string to
    determine which character separates the individual result values
    and supply that as a second parameter to the function.
    Hope this helps!

Maybe you are looking for