Results 1 to 3 of 3
  1. #1
    Ed
    Ed is offline Senior Member
    Join Date
    Jun 2007
    Posts
    110
    Rep Power
    0

    Default Jsp and javascript

    Hi,
    I have a problem, I don't know how can I do that.
    I have a jsp file, that it has a javascript function and I want recollect the information that it returns to me

    Java Code:
    <script language="JavaScript">
    <!--
    	function browser()
    	{
    		var browser= navigator.appName
    		var option = 0;
    		if (browser== "Microsoft Internet Explorer")
    			return option = 0;
    		else
    			return option = 1;
    	}
    //-->
    </script>
    I tried like this but it doesn't work
    Java Code:
    <% int option=browser();
    					if(option==1){
    				%>

  2. #2
    Peter is offline Senior Member
    Join Date
    Jun 2007
    Posts
    119
    Rep Power
    0

    Default

    I give you an example

    Java Code:
    function oBrowser( ) {
    this.name= navigator.appName;
    }
    Java Code:
    browser= new oBrowser();

  3. #3
    Jack is offline Senior Member
    Join Date
    Jun 2007
    Posts
    130
    Rep Power
    0

Similar Threads

  1. Javascript Alert
    By mutuah in forum New To Java
    Replies: 4
    Last Post: 03-25-2010, 05:28 PM
  2. Javascript into Excel
    By gdj100 in forum Advanced Java
    Replies: 0
    Last Post: 03-12-2008, 11:03 AM
  3. please help with javascript code!!!!
    By sahkab in forum New To Java
    Replies: 1
    Last Post: 11-26-2007, 03:20 PM
  4. Javascript - Password Arrays
    By roseheyworth in forum New To Java
    Replies: 1
    Last Post: 11-23-2007, 10:47 PM
  5. javascript validation
    By yuchuang in forum New To Java
    Replies: 5
    Last Post: 05-14-2007, 03:38 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
  •