Java script...Problem with Arrays...

I am feeling quite lame! I am trying to get this dang thing working, it keeps giving me an error on line 15.
I am just learning so please don't laugh!!
This is supposed to be a javascript that will print the frequency of the roll of 2 dice. They print in tables, the face of the dice on the left, and the frequency in the next column.
<html xmlns = "http://www.w3.org/1999/xhtml">
<head>
<title>roll 2 dice 36000 times</title>
<script type = "text/javascript">
<!--
var face, frequency = [ , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ];
// summarize results
for ( var roll = 1; roll <= 36000; ++roll )
          face = function rollDice();
     ++frequency[ face ];
document.writeln( "<table border = \"1\"" +
"width = \"100%\">" );
document.writeln( "<thead><th width = \"100\"" +
" align = \"left\">Face<th align = \"left\">" +
"Frequency</th></thead></tbody>" );
for ( face = 2; face < frequency.length; ++face )
document.writeln( "<tr><td>" + face + "</td><td>" +
frequency[ face ] + "</td></tr>" );
document.writeln( "</tbody></table>" );
     function rollDice(x)
var die1, die2, x;
die1 = Math.floor( 1 + Math.random() * 6 );
die2 = Math.floor( 1 + Math.random() * 6 );
x = die1 + die2;
return x;
// -->
</script>
</head>
<body>
<?xml version = "1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!-- Fig. 11.6: RollDie.html -->
<!-- 11. -->
<p>Click Refresh (or Reload) to run the script again</p>
</body>
</html>
<!--

This is a Java forum, not a Javascript forum. I suggest you take your question elsewhere if you want good answers.

Similar Messages

  • Lingo-Java Script problem with new members

    Hi, I'm new to Director, so this question could be very
    simple, but i can't find the answer in internet.
    I very like Flash and ActionScript and now i've started to
    learn Director.
    When I create a Sprite in a Cast- how can I (with JavaScript)
    copy this Sprite to the Stage as a new object with a new name?
    And the second question - Do you know any good sites, where
    are good articles, tutorials, examples, connected with scripting in
    Director?
    Than you very much :):)

    Thank you :)
    I have unfortunately something wrong translated, because I've
    got no errors, but nothing happens. The script on the 1st Timeline
    frmae is:
    function exitFrame(me) {
    aaa=channel(5).makeScriptedSprite(member("p1"), point(0,1));
    aaa.locV=100;
    trace("t1") //this is traced
    aaa.scriptInstanceList.push(new script("dynamicScript"));
    trace("t2") //this is not traced
    on the second frame:
    function exitFrame(me) {
    _movie.go(2);
    and in the cast (name of this script is "dynamicScript"):
    function enterFrame()
    trace("dsd");
    I'm really thankful to you :)

  • Sreaming at the top of my lungs for HELP with Java Script problem!

    Hello,
    I have this strange problem that no one seems to know why or how to fix it.Whenever I encounter a web site that has java scripting for anything pop ups or redirects to url's anything that says java script when I mouse over the link my browsers do nothing.That is for explorer 6.0 beta netscape 4.7 and netscape version 6.I have tried in another forum some suggestions but nothing changed even though I am told nothing is wrong with the java scripting.I used to be able to click java script's with all of these browsers but no longer.That was a few months ago.Now to try something new I tried to see if a new browser would work.I now have the latest version of Opera.It did work but using Opera on some sites limits what I can do so it doesn't solve my problem.Then I tried the Sun JavaHot browser it also worked but limits what I can do on some site's.I have Windows 98 & updated most of my dll's etc & my java is version 2 1.3.1.My java script is enabled in Explorer & netscape's & the security is at a minimum level.Please help me figure out why these other browsers work but the other's do not.I want to edit a web site of mine but I can't because of this problem.I am very frustrated by this and need as detailed help as I can get.Anything of a suggestion would be very much appreciated.But I am also not an expert on the working's of a computer so bear with me.
    Brian

    Hi,
    Well I am thinking that if anyone could know something about Java script it would be java developers.But anyways I had the previous version of explorer 5.0 & the java didn't work in it either.Now how weird is this,I opened netscape 4.7 today & the java scripts are suddenly working.This has me scratching my head wondering if my computer is possesed by some force beyond my capability to know...????Weird as it seems though the explorer still will not respond to a java script.
    Brian

  • OSB java call out with array parameters

    Hi all,
    I have a java call out with array parameters, follow the firm of java method:
    logBody2(String category, XmlObject headerXml, String[] level, XmlObject[] xml)
    The java call out have String[] and XmlObject[] arrays in intput, my question is how I can pass these arrays of values at java call out?
    Thk
    L.

    For array, comma-separated values should be passed. For e.g. -
    If input parameter is of type String[] then passed values should be comma-separated strings like - 'Anuj','Dwivedi'
    If input parameter is of type XmlObject[] then passed values should be comma-separated XmlObject like - <anuj/>,<dwivedi/>
    Regards,
    Anuj

  • OS X Lion - JAVA SCRIPT PROBLEM

    I recently updated from Snow Leopard to OS X Lion. Now I seem to have a JAVA Script problem. Where do I start fixing this issue. I have checked updates etc etc but it seems to be updated. However, when I login to my web site backend, I have a problem. Any advice please?

    Would you please write some more details? explain the problem and what web site backend you use. Thanks.

  • Adobe Dreamweaver CS5.5 - Windows 7 - Java Script Problem

    I am having trouble with Anchor.htm.
    When I try to insert an anchor in the text (Insert > Named Anchor> I get this error message:
    "While executing insertObject in Anchor.htm a Java Script error occurred."
    I recently downloaded both the 32- and 64-bit Java Script applications when I received a message that the existing version of Java Script was out-of-date. Anchor.htm worked before I installed the update.
    The files I downloaded and installed are:
    jre-7u9-windows-i586.exe
    jre-7u9-windows-x64.exe
    Please can anyone help me with this problem?

    From Dreamweaver FAQ
    http://forums.adobe.com/thread/429114
    "If Dreamweaver is acting erratically, or if you see a message saying "the following JavaScript error(s) occurred",  it's usually a sign of a corrupt cache file. The first thing to try should always be to delete the file cache. If that doesn't work, delete your personal Configuration folder. Full instructions are in Deleting a corrupted cache file.
    http://forums.adobe.com/thread/494811"
    Nancy O.

  • Java script problem when trying to sign in to Ovi ...

    Hi Folks
    I am running XP SP3, with IE7.  I have had problems due to installing ie8 then removing it and going back to IE7.  I have had to reset all sorts of bits.  Anyway. I still can't sign in to the music store, or register my PC for comes with music.  I installed a debugger to see what was going on.  This is my current stage of the problem..... 
    When I sign in, I only get a white panel.  The debugger highlights this section of the java script: __doPostBack('ctl00$C$btnEContinue','')  
    Can someone tell me why this fails, and how I can fix it?
    many thanks.

    I also have the same problem. I've tried all fixes listed in other forums and nothing works. Running windows Vista 32 bit. Any working solutions yet? Tried every solution listed for the cmd prompt. Turned off antivirus and spyware. Rebooting about 100 times. Nothing works.

  • Is there any color picker component , i tried java script ones with no luck

    Hi
    Thank you for reading my post.
    I tried to use a java script color picker inside my JSC portlet , but it does not works.
    i tried many things , but at least i did not find any solution for it.
    here is color picker that i tried to use :
    http://www.flooble.com/scripts/colorpicker.php?op=get
    http://www.flooble.com/scripts/colorpicker.php
    and also i tried to use this one with no luck . i tried both of them in html files and they works
    http://www.mattkruse.com/javascript/colorpicker/
    can some one with more knowledge about javascript and JSC help me ?

    any comment or advice on this problem ?

  • Java script problem

    Hai all,
    i had a problem regarding java script,i had a time shedule page in which there is a start time and end time for each day,means monday,tuesday......
    the problem is when i select monday it shows '0000' in start up but when i de select means change to 'no it will not rest the value to '0000',how can i do this my code is PROBLEM WHEN ONCE SELECTED YES AFTER FIRDAY I WANT TO CHANGE THE TIME OR RESET THE TIME OF SUNDAY TO 'NO' THEN THE DEFAULT VALUE ie "0000" WILL NOT ENTER THE DATA BASE BUT THE ENTERED VALUE HOW WILL I CORRECT IT OR I HAD TO USE AJAX FOR REPOPULATE THE TEXT BOX WITH "0000".and how can i popup a calender insted of this.
    <%@ page language="java" pageEncoding="ISO-8859-1"%>
    <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
    <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
    <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
    <%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html:html lang="true">
    <head>
    <%String path=request.getContextPath();
    String basepath=request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path;%>
    <title>BLUE LAW</title>
         <meta http-equiv="pragma" content="no-cache">
         <meta http-equiv="cache-control" content="no-cache">
         <meta http-equiv="expires" content="0">
         <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
         <meta http-equiv="description" content="This is my page">
    <script type="text/javascript">
    function display(val, id1,id2)
         if(val=="Y")
         document.getElementById(id1).style.display="block";
         document.getElementById(id1).style.visibility="visible";
         document.getElementById(id2).style.display="block";
         document.getElementById(id2).style.visibility="visible";
         else
         document.getElementById(id1).style.display="none";
         document.getElementById(id1).style.visibility="hidden";
         document.getElementById(id2).style.display="none";
         document.getElementById(id2).style.visibility="hidden";
         function newWindow(url) {
         popupWindow = window.open(url,'popUpWindow','height=300,width=250,left=50,top=50,resizable=no,scrollbars=no,toolbar=no,menubar=no,location=no,directories=no,status=yes');
         var timeout = 500;
    var closetimer          = 0;
    var ddmenuitem = 0;
    // open hidden layer
    function mopen(id)
         // cancel close timer
         mcancelclosetime();
         // close old layer
         if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
         // get new layer and show it
         ddmenuitem = document.getElementById(id);
         ddmenuitem.style.visibility = 'visible';
    // close showed layer
    function mclose()
         if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
    // go close timer
    function mclosetime()
         closetimer = window.setTimeout(mclose, timeout);
    // cancel close timer
    function mcancelclosetime()
         if(closetimer)
              window.clearTimeout(closetimer);
              closetimer = null;
    // close layer when click-out
    document.onclick = mclose;
    </script>
         <style type="text/css">
    <!--
    body {
         background-color: #e1f2f8;
    .style1 {     font-family: Verdana, Arial, Helvetica, sans-serif;
         font-size: 12px;
    .style5 {color: #EEF0EC}
    -->
    </style>
    <link href="<%=basepath%>/style/style.css" rel="stylesheet" type="text/css">
         <link rel="stylesheet" type="text/css" href="<%=basepath%>/css/default.css">
    </head>
    <body topmargin="0">
    <html:errors/>
    <html:form method="get" action="addblue.do" onsubmit="return validateTYUY(this);">
    <input type="hidden" name="action" value="Add"/>
    <table width="891" border="1" align="center" cellpadding="4" cellspacing="0" >
    <tr >
    <th colspan="4" ><b><strong>Enter TIME Details</strong></b></th>
    </tr>
    <tr >
    <td width="421" class="Label" align="right"> Number</td>
    <td width="448" ><html:text styleClass="Textfield" property="ABCnumber" size="2" maxlength="2" ></html:text><br></td>
    </tr>
    <tr>
    <td> <table>
    <tr >
    <td class="Label" ></td>
    <td width="62" ></td>
    <td class="Label" ></td>
    <td width="68" ></td>
    </tr>
    <tr >
    <td class="Label" width="152"> Restrict on Sundays</td>
    <td style="background-color: rgb(255, 255, 255);"><html:select property="sundayrest" styleClass="Textfield" onchange="display(this.value, 'sunday','sunday1')" >
    <html:option value="">select</html:option>
    <html:option value="Y">YES</html:option>
    <html:option value="N">NO</html:option> </html:select></td>
    <td class="Label" ></td>
    <td ></td>
    </tr>
    <tr style="visibility: hidden;display:none;" id="sunday" >
    <td width="140" class="Label" style="background-color: rgb(255, 255, 255);"> Sundays Start Time 1</td>
    <td style="background-color: rgb(255, 255, 255);"><html:text styleClass="Textfield" property="sundaystart1" value="0000" size="5" maxlength="4"></html:text>(HHMM)</td>
    <td width="133" class="Label" style="background-color: rgb(255, 255, 255);">Sundays Start Time 1</td>
    <td style="background-color: rgb(255, 255, 255);"><html:text styleClass="Textfield" property="sundayend1" value="0000" size="5" maxlength="4"></html:text>(HHMM)</td>
    </tr>
    <tr style="visibility: hidden;display:none;" id="sunday1" >
    <td width="140" class="Label" style="background-color: rgb(255, 255, 255);">Sundays Start Time 2</td>
    <td style="background-color: rgb(255, 255, 255);"> <html:text styleClass="Textfield" property="sundaystart2" value="0000" size="5" maxlength="4"></html:text>(HHMM)</td>
    <td class="Label" style="background-color: rgb(255, 255, 255);">Sundays End Time 2</td>
    <td style="background-color: rgb(255, 255, 255);"><html:text styleClass="Textfield" property="sundayend2" value="0000" size="5" maxlength="4"></html:text>(HHMM)</td>
    </tr>
    </table></td>
    <td> <table>
    <tr >
    <td width="160" class="Label" >Restrict on Mondays</td>
    <td width="59" style="background-color: rgb(255, 255, 255);"><html:select property="mondayrest" styleClass="Textfield" onchange="display(this.value, 'monday','monday1')">
    <html:option value="">select</html:option>
    <html:option value="Y">YES</html:option> <html:option value="N">NO</html:option>
    </html:select></td>
    <td class="Label" ></td>
    <td width="70" ></td>
    </tr>
    <tr style="visibility: hidden;display:none;" id="monday">
    <td class="Label" style="background-color: rgb(255, 255, 255);">Monday End Time 1</td>
    <td style="background-color: rgb(255, 255, 255);"><html:text styleClass="Textfield" property="mondayend1" value="0000" size="5" maxlength="4"></html:text>(HHMM)</td>
    <td width="148" class="Label" style="background-color: rgb(255, 255, 255);">Monday Start Time 1</td>
    <td style="background-color: rgb(255, 255, 255);"> <html:text styleClass="Textfield" property="mondaystart1" value="0000" size="5" maxlength="4"></html:text>(HHMM)</td>
    </tr>
    <tr id="monday1" style="visibility: hidden;display:none;" >
    <td class="Label" style="background-color: rgb(255, 255, 255);">Monday End Time 2</td>
    <td style="background-color: rgb(255, 255, 255);"><html:text styleClass="Textfield" property="mondayend2" value="0000" size="5" maxlength="4"></html:text>(HHMM)</td>
    <td class="Label" style="background-color: rgb(255, 255, 255);">Monday Start Time 2</td>
    <td style="background-color: rgb(255, 255, 255);"><html:text styleClass="Textfield" property="mondaystart2" value="0000" size="5" maxlength="4"></html:text>(HHMM)</td>
    </tr>
    </table></td>
    </tr>
    <tr>
    <td> <table>
    <tr>
    <td class="Label" width="152">Restrict on Tuesdays</td>
    <td width="62" style="background-color: rgb(255, 255, 255);"><html:select property="tuesdayrest" styleClass="Textfield" onchange="display(this.value, 'tue','tue1')">
    <html:option value="">select</html:option>
    <html:option value="Y">YES</html:option> <html:option value="N">NO</html:option>
    </html:select></td>
    <td class="Label" ></td>
    <td width="70" ></td>
    </tr>
    <tr style="visibility: hidden;display:none;" id="tue">
    <td width="138" class="Label" style="background-color: rgb(255, 255, 255);">Tuesday Start Time1</td>
    <td style="background-color: rgb(255, 255, 255);"><html:text styleClass="Textfield" property="tuesdaystart1" value="0000" size="5" maxlength="4"></html:text>(HHMM)</td>
    <td width="131" class="Label" style="background-color: rgb(255, 255, 255);">Tuesday End Time1</td>
    <td style="background-color: rgb(255, 255, 255);"><html:text styleClass="Textfield" property="tuesdayend1" value="0000" size="5" maxlength="4"></html:text>(HHMM)</td>
    </tr>
    <tr style="visibility: hidden;display:none;" id="tue1">
    <td width="138" class="Label" style="background-color: rgb(255, 255, 255);">Tuesday Start Time 2</td>
    <td style="background-color: rgb(255, 255, 255);"> <html:text styleClass="Textfield" property="tuesdaystart2" value="0000" size="5" maxlength="4"></html:text>(HHMM)</td>
    <td class="Label" style="background-color: rgb(255, 255, 255);">Tuesday End Time2</td>
    <td style="background-color: rgb(255, 255, 255);"><html:text styleClass="Textfield" property="tuesdayend2" value="0000" size="5" maxlength="4"></html:text>(HHMM)</td>
    </tr>
    </table></td>
    <td> <table>
    <tr>
    <td width="160" class="Label" >Restrict On Wednesdays</td>
    <td width="58" style="background-color: rgb(255, 255, 255);"><html:select property="wednesdayrest" styleClass="Textfield" onchange="display(this.value, 'wed','wed1')">
    <html:option value="">select</html:option>
    <html:option value="Y">YES</html:option> <html:option value="N">NO</html:option>
    </html:select></td>
    <td class="Label" ></td>
    <td width="68" ></td>
    </tr>
    <tr style="visibility: hidden;display:none;" id="wed">
    <td class="Label" style="background-color: rgb(255, 255, 255);">Wednesday End Time1</td>
    <td style="background-color: rgb(255, 255, 255);"><html:text styleClass="Textfield" property="wednesdayend1" value="0000" size="5" maxlength="4"></html:text>(HHMM)</td>
    <td width="149" class="Label" style="background-color: rgb(255, 255, 255);"> Wednesday Start Time1</td>
    <td style="background-color: rgb(255, 255, 255);"> <html:text styleClass="Textfield" property="wednesdaystart1" value="0000" size="5" maxlength="4"></html:text>(HHMM)</td>
    </tr>
    <tr style="visibility: hidden;display:none;" id="wed1">
    <td class="Label" style="background-color: rgb(255, 255, 255);">Wednesday End Time2:</td>
    <td style="background-color: rgb(255, 255, 255);"><html:text styleClass="Textfield" property="wednesdayend2" value="0000" size="5" maxlength="4"></html:text>(HHMM)</td>
    <td class="Label" style="background-color: rgb(255, 255, 255);">Wednesday Start Time2</td>
    <td style="background-color: rgb(255, 255, 255);"><html:text styleClass="Textfield" property="wednesdaystart2" value="0000" size="5" maxlength="4"></html:text>(HHMM)</td>
    </tr>
    </table></td>
    </tr>
    <tr>
    <td><table>
    <tr >
    <td class="Label" width="150">Restrict On Thursdays</td>
    <td width="61" style="background-color: rgb(255, 255, 255);"><html:select property="thursdayrest" styleClass="Textfield" onchange="display(this.value, 'thu','thu1')">
    <html:option value="">select</html:option>
    <html:option value="Y">YES</html:option> <html:option value="N">NO</html:option>
    </html:select></td>
    <td ></td>
    <td ></td>
    </tr>
    <tr style="visibility: hidden;display:none;" id="thu" >
    <td width="140" class="Label" style="background-color: rgb(255, 255, 255);">Thursday Start Time1</td>
    <td style="background-color: rgb(255, 255, 255);"><html:text styleClass="Textfield" property="thursdaystart1" value="0000" size="5" maxlength="4"></html:text>(HHMM)</td>
    <td width="132" class="Label" style="background-color: rgb(255, 255, 255);">Thursday End Time1</td>
    <td style="background-color: rgb(255, 255, 255);"><html:text styleClass="Textfield" property="thursdayend1" value="0000" size="5" maxlength="4"></html:text>(HHMM)</td>
    </tr>
    <tr style="visibility: hidden;display:none;" id="thu1">
    <td width="140" class="Label" style="background-color: rgb(255, 255, 255);">Thursday Start Time2</td>
    <td style="background-color: rgb(255, 255, 255);"> <html:text styleClass="Textfield" property="thursdaystart2" value="0000" size="5" maxlength="4"></html:text>(HHMM)</td>
    <td class="Label" style="background-color: rgb(255, 255, 255);">Thursday End Time2</td>
    <td style="background-color: rgb(255, 255, 255);"><html:text styleClass="Textfield" property="thursdayend2" value="0000" size="5" maxlength="4"></html:text>(HHMM)</td>
    </tr>
    </table></td>
    <td> <table>
    <tr >
    <td class="Label" width="170">Restrict On Fridays</td>
    <td width="57" style="background-color: rgb(255, 255, 255);"><html:select property="fridayrest" styleClass="Textfield" onchange="display(this.value, 'fri','fri1')">
    <html:option value="">select</html:option>
    <html:option value="Y">YES</html:option>
    <html:option value="N">NO</html:option> </html:select></td>
    <td width="150" class="Label" > </td>
    <td width="66" ></td>
    </tr>
    <tr style="visibility: hidden;display:none;" id="fri">
    <td class="Label" style="background-color: rgb(255, 255, 255);">Friday End Time1</td>
    <td style="background-color: rgb(255, 255, 255);"><html:text styleClass="Textfield" property="fridayend1" value="0000" size="5" maxlength="4"></html:text>(HHMM)</td>
    <td class="Label" style="background-color: rgb(255, 255, 255);">Friday Start Time1</td>
    <td style="background-color: rgb(255, 255, 255);"><html:text styleClass="Textfield" property="fridaystart1" value="0000" size="5" maxlength="4"></html:text>(HHMM)</td>
    </tr>
    <tr style="visibility: hidden;display:none;" id="fri1" >
    <td width="153" class="Label" style="background-color: rgb(255, 255, 255);">Friday End Time2</td>
    <td style="background-color: rgb(255, 255, 255);"><html:text styleClass="Textfield" property="fridayend2" value="0000" size="5" maxlength="4"></html:text>(HHMM)</td>
    <td width="150" class="Label" style="background-color: rgb(255, 255, 255);">Friday Start Time2</td>
    <td style="background-color: rgb(255, 255, 255);"><html:text styleClass="Textfield" property="fridaystart2" value="0000" size="5" maxlength="4"></html:text>(HHMM)</td>
    </tr>
    </table></td>
    </tr>
    <tr>
    <td> <table>
    <tr >
    <td width="162" class="Label" > Restrict On Saturdays</td>
    <td width="61" style="background-color: rgb(255, 255, 255);"><html:select property="saturdayrest" styleClass="Textfield" onchange="display(this.value, 'sat','sat1')">
    <html:option value="">select</html:option>
    <html:option value="Y">YES</html:option> <html:option value="N">NO</html:option>
    </html:select></td>
    <td width="132" class="Label" ></td>
    <td width="66" ></td>
    </tr>
    <tr style="visibility: hidden;display:none;" id="sat">
    <td width="140" class="Label" style="background-color: rgb(255, 255, 255);"> Saturday Start Time 1</td>
    <td style="background-color: rgb(255, 255, 255);"><html:text styleClass="Textfield" property="saturdaystart1" value="0000" size="5" maxlength="4"></html:text>(HHMM)</td>
    <td width="132" class="Label" style="background-color: rgb(255, 255, 255);">Saturday End Time1</td>
    <td style="background-color: rgb(255, 255, 255);"><html:text styleClass="Textfield" property="saturdayend1" value="0000" size="5" maxlength="4"></html:text>(HHMM)</td>
    </tr>
    <tr style="visibility: hidden;display:none;" id="sat1">
    <td width="140" class="Label" style="background-color: rgb(255, 255, 255);"> Saturday Start Time2</td>
    <td style="background-color: rgb(255, 255, 255);"><html:text styleClass="Textfield" property="saturdaystart2" value="0000" size="5" maxlength="4"></html:text>(HHMM)</td>
    <td width="132" class="Label" style="background-color: rgb(255, 255, 255);">Saturday End Time2</td>
    <td style="background-color: rgb(255, 255, 255);"><html:text styleClass="Textfield" property="saturdayend2" value="0000" size="5" maxlength="4"></html:text>(HHMM)</td>
    </tr>
    </table></td><td> </td>
    </tr>
    <tr>
    <td height="27" colspan="4" align="center"><html:submit value="Save"></html:submit>
    <html:reset value="Cancel" onclick="window.close();"></html:reset></td>
    </tr>
    </table>
    <html:javascript formName="ert"/>
    </html:form>
    </body>
    </html:html>

    [some javascript forum...|http://www.webdeveloper.com/forum/forumdisplay.php?forumid=3&s]

  • Visual Web JSF and Java Script problem

    Hi i am using Visual Web JSF for development in my project. AJAX to update data from server when users enters data in one text box its an chat application. i am getting data from server but unable to update my <webuijsf:textarea> component with the new data on my chat page ... I am facing another problem in java script that it is not accepting relational operators (< . >) in JSF Application.... i am attaching some code here for reference...result =http.responseText.split(","); /// this is the response text from AJAX based call
    var obj=document.getElementById('form1:chatter_box'); /// this text area is to be updated...
    var txt=document.createTextNode(http.responseText);
    ///document.getElementById('form1:chatter_box').innerHTML = txt;
    for(i=0;i < size;i++){
    var txt1=document.createTextNode(result);
    obj.appendChild(txt1);

    Try changing onclick to onClick and try...
    regards
    shanu

  • Java/OpenJDK problem with OSS/osspd/ALSA/pulseaudio [SOLVED]

    I've got problems with sound output of java programs, which usually try to hog /dev/dsp, using pulseaudio and openjdk 7.
    Some rare java apps' sound methods surprisingly do work. Others (which the majority of java programs seem to use) do not. In Sun Java I could make those work by using 'padsp', however this method apparently fails on Archlinux with both latest Oracle Java (formerly worked on Ubuntu w/ Sun Java 6) and with OpenJDK too.
    So I tried 'osspd' (package is called 'ossp') and it shows the root process "/usr/sbin/osspd --dsp-slave=/usr/sbin/ossp-padsp" been started, but the java applications will still not provide sound which I find pretty odd. I tried adding 'soundcore.preclaim_oss=0' to the 'kernel..' line in my grub's menu.lst, but that didn't help either.
    Last edited by Jindur (2012-05-20 02:59:20)

    It's been quite a while, but I finally found a solution (read: big ugly hack).
    Someone literally created a biguglyhack and posted it here:
    http://lifein19x19.com/forum/viewtopic. … 243#p98243
    (downloadable file there: javadummymixer_biguglyhack.zip [12.97 KiB] -> rename it from .zip to .jar and move it into your java's lib/ext folder -> profit!)
    I applied it to OpenJDK 6 (should be same for 7 though) and all my java sound works flawlessly now, with pulseaudio, without any need for padsp stuff or osspd or whatever.
    My sound.properties file reads:
    javax.sound.sampled.Clip=com.sun.media.sound.DirectAudioDeviceProvider
    javax.sound.sampled.Port=com.sun.media.sound.PortMixerProvider
    javax.sound.sampled.SourceDataLine=com.sun.media.sound.DirectAudioDeviceProvider
    javax.sound.sampled.TargetDataLine=com.sun.media.sound.DirectAudioDeviceProvider
    but actually I'm not sure whether that even matters at all.
    (Side note: The linked thread also mentions a "-D.sun.." command-line parameter that supposedly forces java to avoid disfunctional audio methods. The above biguglyhack however worked for me without any need of applying that command-line parameter.)
    Last edited by Jindur (2012-05-20 02:58:05)

  • JAVA arithmetic problem with double ?

    If I try to work double precision numbers I get a unintelligible result, but what do I do wrong ?
    Are there any inaccuracy in the JAVA double precision numbers arithmetic or what's the problem with this very simple example code ? How can I get correct result ?
    Simple example code :
    ================
    for (double i = 0; i < 10; i = i + 0.01)
    System.out.println(i);
    On the output :
    ===========
    0.0
    0.01
    0.02
    0.03
    0.04
    0.05
    0.060000000000000005
    0.07
    0.08
    0.09
    0.09999999999999999
    0.10999999999999999
    0.11999999999999998
    0.12999999999999998
    0.13999999999999999
    0.15
    0.16
    0.17
    0.18000000000000002
    0.19000000000000003
    0.20000000000000004
    0.21000000000000005
    0.22000000000000006
    0.23000000000000007
    0.24000000000000007
    0.25000000000000006
    0.26000000000000006
    0.2700000000000001
    0.2800000000000001
    0.2900000000000001
    0.3000000000000001
    0.3100000000000001
    0.3200000000000001
    0.3300000000000001
    0.34000000000000014
    0.35000000000000014
    0.36000000000000015
    0.37000000000000016
    0.38000000000000017
    0.3900000000000002
    0.4000000000000002
    0.4100000000000002
    0.4200000000000002
    0.4300000000000002
    0.4400000000000002
    0.45000000000000023
    0.46000000000000024
    0.47000000000000025
    0.48000000000000026
    0.49000000000000027
    0.5000000000000002
    0.5100000000000002
    0.5200000000000002
    0.5300000000000002
    0.5400000000000003
    0.5500000000000003
    0.5600000000000003
    0.5700000000000003
    0.5800000000000003
    0.5900000000000003
    0.6000000000000003
    0.6100000000000003
    0.6200000000000003
    0.6300000000000003
    0.6400000000000003
    0.6500000000000004
    0.6600000000000004
    0.6700000000000004
    0.6800000000000004
    0.6900000000000004
    0.7000000000000004
    0.7100000000000004
    0.7200000000000004
    0.7300000000000004
    0.7400000000000004
    0.7500000000000004
    0.7600000000000005
    0.7700000000000005
    0.7800000000000005
    0.7900000000000005
    0.8000000000000005
    0.8100000000000005
    0.8200000000000005
    0.8300000000000005
    0.8400000000000005
    0.8500000000000005
    0.8600000000000005
    0.8700000000000006
    0.8800000000000006
    0.8900000000000006
    0.9000000000000006
    0.9100000000000006
    0.9200000000000006
    0.9300000000000006
    0.9400000000000006
    0.9500000000000006
    0.9600000000000006
    0.9700000000000006
    0.9800000000000006
    0.9900000000000007
    1.0000000000000007
    1.0100000000000007
    1.0200000000000007
    1.0300000000000007
    1.0400000000000007
    1.0500000000000007
    1.0600000000000007
    1.0700000000000007
    1.0800000000000007
    1.0900000000000007
    1.1000000000000008
    1.1100000000000008
    1.1200000000000008
    1.1300000000000008
    1.1400000000000008
    1.1500000000000008
    1.1600000000000008
    1.1700000000000008
    1.1800000000000008
    1.1900000000000008
    1.2000000000000008
    1.2100000000000009
    1.2200000000000009
    1.2300000000000009
    1.2400000000000009
    1.2500000000000009
    1.260000000000001
    1.270000000000001
    1.280000000000001
    1.290000000000001
    1.300000000000001
    1.310000000000001
    1.320000000000001
    1.330000000000001
    1.340000000000001
    1.350000000000001
    1.360000000000001
    1.370000000000001
    1.380000000000001
    1.390000000000001
    1.400000000000001
    1.410000000000001
    1.420000000000001
    1.430000000000001
    1.440000000000001
    1.450000000000001
    1.460000000000001
    1.470000000000001
    1.480000000000001
    1.490000000000001
    1.500000000000001
    1.5100000000000011
    1.5200000000000011
    1.5300000000000011
    1.5400000000000011
    1.5500000000000012
    1.5600000000000012
    1.5700000000000012
    1.5800000000000012
    1.5900000000000012
    1.6000000000000012
    1.6100000000000012
    1.6200000000000012
    1.6300000000000012
    1.6400000000000012
    1.6500000000000012
    1.6600000000000013
    1.6700000000000013
    1.6800000000000013
    1.6900000000000013
    1.7000000000000013
    1.7100000000000013
    1.7200000000000013
    1.7300000000000013
    1.7400000000000013
    1.7500000000000013
    1.7600000000000013
    1.7700000000000014
    1.7800000000000014
    1.7900000000000014
    1.8000000000000014
    1.8100000000000014
    1.8200000000000014
    1.8300000000000014
    1.8400000000000014
    1.8500000000000014
    1.8600000000000014
    1.8700000000000014
    1.8800000000000014
    1.8900000000000015
    1.9000000000000015
    1.9100000000000015
    1.9200000000000015
    1.9300000000000015
    1.9400000000000015
    1.9500000000000015
    1.9600000000000015
    1.9700000000000015
    1.9800000000000015
    1.9900000000000015
    2.0000000000000013
    2.010000000000001
    2.020000000000001
    2.0300000000000007
    2.0400000000000005
    2.0500000000000003
    Thanks for answerers !
    Joseph

    This result is entirely unsurprising, and the flaw lies in your program, not in Java.
    Java represents numbers in 2's complement [SEM] form (read the Java Language Specification (JLS), according to agreed standards. When you specify a fractional number that appears to be nice and easy to work with, you are thinking in decimal notation, not binary, and you are giving it a number that cannot be precisely represented. It is a little like asking you to write down exactly what pi is (all its digits ;-)).
    So the number you get is not precisely what you asked for (one very insignificant error). But then you compound it by adding an inaccurately represented number to an inaccurately represented number, and so on, until the bit errors combine to make a very inaccurate number.
    The correct way to approach what you are trying to do would be to perform the addition using integers, and multiply each time you want to scale it to a double.
    This has been asked many times - I would suggest you:
    - Search the forums
    - Check out the language spec
    - or do a degree in CompSci :-)
    A calculator is a little more accurate because it does not have to conform to agreed standards, and so can use special logic to minimise such errors. The average pocket calulator also works to a much lower level of accuracy (usu 8 digits), and therefore masks the errors to you. You'd find that you got the same effect if you played with it long enough.
    Hope this helps

  • Java debugging - problems with standard input

    Hi
    I hope somebody can help me with this problem.
    I'm developing a Java app that reads from the standard input. I use System.in.read() to do that. When I debug it, I use the Standard I/O window instead of the Run Log window to pass in values, but nothing happens (i.e. the line following the read() is never reached). I also tried to run the app and then attach the debugger to use the Run Log window as standard input, with the same result. If I add a breakpoint before the call to read(), the debugger pauses the execution, so I suppose the breakpoints are OK.
    In the executable Info window, Debugging tab, I use the pseudo terminal with the Java debugger.
    So my question is: how can I enter values from the standard input in debugging mode?

    I believe that you are seeing these problems because we have found the
    current versions of RMI found in the JDK to be inherently unscalable -- we
    do not listen for them. As you noticed, we recommend that you use our
    packages for now, and then do the simple change that you found if you decide
    that you do not like WLS. (If you do decide that you do not like us, please
    definitely let us know why you chose the way you did!)
    Thanks,
    Michael
    Michael Girdley
    Product Manager, WebLogic Server & Express
    BEA Systems Inc
    "Tim Dawson" <[email protected]> wrote in message
    news:397b8cc2$[email protected]..
    We're developing a J2EE application on NT using WLS 5.1, SP3, but we don't
    want to be tied to any particular J2EE server, so we're making sure that
    none of our code is weblogic specific.
    In keeping with this philosophy, I created an RMI service that used the
    standard java.rmi.* imports instead of weblogic.rmi.* and used thestandard
    RMIC compiler rather than the weblogic.rmic compiler.
    Unfortunately, I couldn't get the system to work. I kept getting
    "java.rmi.MarshalException: Error marshaling transport header; nested
    exception is: java.io.EOFException" whenever I'd call Naming.lookup().
    Of course, when I did the search & replace with java.rmi.* with
    weblogic.rmi.*, and switched from the standard rmic to weblogic.rmic,
    everything started working just fine. This is the ONLY change I made!
    Has anyone else run into similar problems?
    Tim Dawson
    Sr. Software Architect
    is.com

  • Java script error with adobe form

    Hi All,
    We had installed Adobe Document server recently.
    while trying to open the ess - expense detail form through PDF we are gettng following error in sequence
    Intenet Explorer Script error
    1. 'sapUrDomainRelaxing' is undefined
    2. object expected
    3. 'ssr' undefined
    then we are getting blank page .
    but if are changing the mode and open the expense detail through HTML then everything is ok.
    we had checked the following
    1) namespace defnition
    2) services active in transaction SICF
    3) there is no problem with the installation of Adobe server.
    4)There is no mismatch with the server version
    in order to open ess/mss application through adobe any other pre-requiste has to be met at browser and server side
    any ideas would be welcomed
    ofcourse points will be awarded
    Expecting urs valuable reply
    Regards,
    vijay.

    Hi
    atlast we scaled down reason for this error is that problem with the installation of ACF.
    BUt unfortunately the file xAcf_NW711_SP00.exe is not available anymore from sap note 766191
    https://sapmats-de.sap-ag.de/download/download.cgi?
    id=F9RUZ3Q7TERUBSMHSXWT3UMEM59IJYIPA931VQD32A1UNAKZ6B
    So if u guys can send me the link to download this file or if u can send me the file through email would be really thankful to you guys.
    Thanks
    Vijay.
    ps: A special thanks to Gurprit Bhatia for scaling down the reason

  • TOC/Script problem with Netscape

    I am using RoboHelp (webhelp) 5.5.
    I am facing two problem with netscape browser.
    1. loading the page itself take long time and show a message
    that script on this page is causing mozilla to run slowly.
    2. in the TOC when i click the TOC BOOK the content of the
    page inside that book is opened in new tab page in the same browser
    instant

    Hello Robo_Rajesh,
    Welcome to the forum.
    As a start point, I would suggest you check the following on
    Peter Grainge's web site for an explanation.
    Click
    here.
    Hope this helps.
    Brian

  • Rollover Java Script Problem

    I just upgaded to a new Windows 8 system and also upgraded from old Macromedia Dreamweaver 8 to CS6.
    On my old system, when I inserted an image object / rollover image, the code that was written inserted BORDER="0".
    That made it so when viewed in a browser, the image was not bordered with hyperlink blue/purple.
    My new system does not put the Border="0" in the code and thus I get a border of the rollover image in hyperlink colors.
    I've tried changing the CSS for links, etc. and it does not have any effect on rollovers.
    How do I get the java script writer to add that after the image size in the source code the dialog box creates???
    Your help is much appreciated!

    Thanks Ben,
    Thanks for your help with the ‘LISTINGS’ page on my website (link below).
    Setting up CCS for no border for tag “a img” (link images) got the effect I need without changing the other image types on the page that have their own formatting.
    However, years ago, using a 6 inch thick dreamweaver book, I was able somehow to save a variable BORDER=”0” in some way that changed the Java Script to automatically insert that when using the top menu, to insert image object / rollover image. Do know of a way to change the behavior attribute for rollover (image swap / image restore)???
    I know there’s a way. Do you know how to do it?
    GORDON HUNT
    REALTOR
    CHAPMAN RICHARDS & ASSOC.
    801-486-7075
    <http://www.gordonhuntrealestate.com/> GordonHuntRealEstate.com
    P.S. The Finest Compliment I Can Receive Is Your Referral!

Maybe you are looking for