A simple function won't start/work :-(


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: A simple function won't start/work :-(

  1. #1
    Join Date
    Jun 2006
    Posts
    5

    A simple function won't start/work :-(

    Code:
    <html dir="rtl">
    
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1255">
    <title>Edut</title>
    </head>
    
    <body>
    <p align="center">
    <a href="javascript:edut();">click!</a>
    
    </body>
    
    </html>
    
    <script language="javascript">
    function edut()
    {
    string s = "i liv*d*e in i*m*srael";
    string s2 = null;
    string [] arr = s.split("*");
        for(var i=0;i<arr.length;i+2;)
        {
            for(var j=0;j<arr.length;j++)
            {
                s2+=" ";
            }
            s2+=arr[i+1];
        }
    document.write(s2);
    document.write(s);
    }
    </script>
    FrontPage report this error:
    Code:
    LINE 20
    CHAR 8
    EXPECT ";"
    In firefox and Internet explorer, when I click the link it simpley does nothing.

    the objective of the function is to make each letter between the "*" apper in the exact position of the letter before it, in the line above.


    why doesn't it work fellas?

  2. #2
    Join Date
    Jun 2006
    Posts
    5
    anyone has an idea about what the problem can be>?

  3. #3
    Join Date
    Aug 2006
    Posts
    4
    for(var j=0;j<arr.length;j++; ) - need the ; after the ++

  4. #4
    Join Date
    Mar 2004
    Posts
    635
    you'll probably get faster responses in a javascript forum, not java. Two completely different things.

Similar Threads

  1. call function for button
    By angela_quests in forum VB Classic
    Replies: 2
    Last Post: 04-13-2007, 05:57 AM
  2. Search System Tray
    By MyPlague in forum .NET
    Replies: 2
    Last Post: 03-20-2006, 06:18 PM
  3. comparing function pointers [was: typedef problem]
    By swapnil_paranja in forum C++
    Replies: 20
    Last Post: 08-25-2005, 04:54 PM
  4. Replies: 8
    Last Post: 03-08-2003, 07:25 PM
  5. Trying to print a PDF File from VB
    By Kunal Sharma in forum VB Classic
    Replies: 2
    Last Post: 04-25-2000, 04:45 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center