File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other Java Products and Servers and the fly likes Javascript code is required Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Java Products and Servers
Bookmark "Javascript code is required" Watch "Javascript code is required" New topic
Author

Javascript code is required

kademane guru
Greenhorn

Joined: Feb 20, 2007
Posts: 21
Hi JavaRanchers,
I want find the alert() itself in a javascript file(i.e how many alerts are there in one .js file) and also the line number of that string.Please can anybody help me how to solve this problem?.
[ May 06, 2008: Message edited by: kademane guru ]
K. Tsang
Bartender

Joined: Sep 13, 2007
Posts: 2368
    
    7

why don't read the js file into some text file and loop through text file counting alert() statements and keeping track on the counter as the line number?


K. Tsang JavaRanch SCJP5 SCJD/OCM-JD OCPJP7 OCPWCD5
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41509
    
  53
Are you planning to write Java code to do this, or are we talking about some other kind of environment?


Ping & DNS - my free Android networking tools app
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Javascript code is required