DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 4 of 4
  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, 04:57 AM
  2. Search System Tray
    By MyPlague in forum .NET
    Replies: 2
    Last Post: 03-20-2006, 05:18 PM
  3. comparing function pointers [was: typedef problem]
    By swapnil_paranja in forum C++
    Replies: 20
    Last Post: 08-25-2005, 03:54 PM
  4. Replies: 8
    Last Post: 03-08-2003, 06: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, 03:45 PM

Bookmarks

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


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links