Retrieving Java.vendor into Javascript code

Hi, I need to check whether the user has the "Use Java 2 version<??> <applet>" (i.e. is using Sun, rather than Microsoft) checked in advanced options under 'internet options' in IE6.
I tried to do this by using the code examples in this thread to pull back the java.vendor value (see below for html and applet)
However, even if the check box is not ticked, I recieve the Java.vendor value "Sun Microsystems"
However, when I run the following example applet (written by someone else who has managed to pull back system info), I get back the the Java.vendor value of "Microsoft" correctly, when the above box is unchecked, and the value of "Sun Microsystems" when the value is checked. <http://www.codeconduct.com/java/SysInfoDemo/SysViewerDemo.htm>
I also noticed that when I ran my script, the Java symbol pops up in the system tray.
Why the discrepancy? and how can I alter my code to send back the correct java.vendor to my Javascript code.
Thanks for your help
Roger
//////////////DETECTPLUGIN.HTML///////////////////////////////
<HTML>
<HEAD>
<TITLE>Detect Java Runtime</TITLE>
</HEAD>
<SCRIPT LANGUAGE="JavaScript">
var browsername;
function getJava()
var applet = document.myApplet;
if(applet == null)
document.writeln("Java Runtime Environment not installed");
document.writeln("JRE Version: " + document.myApplet.getJavaVersion());
</SCRIPT>
<body onLoad="getJava()">
<OBJECT id="myApplet" classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
WIDTH = 1
HEIGHT = 1 >
<PARAM NAME = CODE VALUE = "DetectPluginApplet.class" >
<PARAM NAME="scriptable" VALUE="true" >
<embed type="application/x-java-applet;version=1.3"
code = DetectPluginApplet width = 2 height = 2 MAYSCRIPT = "true" >
</embed>
</EMBED>
</object>
</BODY>
</HTML>
//////////////////DetectPluginApplet.java/////////////////
import java.awt.*;
public class DetectPluginApplet extends java.applet.Applet
public void init()
add(new Label("DetectPluginApplet"));
public String getJavaVersion()
return System.getProperty("java.vendor");
}

I should add that I have Sun's Java 2 Runtime Environment 1.4.0_02 installed on my machine. Also, the checbox in 'advanced options' is under "Java(Sun)"

Similar Messages

  • How to pass java arraylist into javascript arrays

    Hi, i have declare an arraylist
    ArrayList list1 = new ArrayList();Inside the arraylist, there are elements. Now, i wan to pass the elements in the java arraylist into javascript arrays but i encounter javascript errors.
    This is how i code.
    var arr1 = new Array();
    <%
    for ( int x =0; x<list1.size(); x++)
    %>
         arr1[<%=x%>] = <%=(String)list1.get(x)%>;
    <%
    %>how do i solve this problem?
    Thanks for the guidance in advance

    JTech wrote:
    Hi,
    Use Quotes around string value ( arr1[indexposition] = "stringvalue";), when assign to javascript array as below.
    arr1[<%=x%>] = "<%=(String)list1.get(x)%>"; Regards,
    Ram.Hi Ram,
    How about using arr1 = <%=list.toArray()%> ??? Is this possible? I tried it but was not working on my IDE. Do you have any solutions for this??
    Regards,
    Thiagu

  • How can we  use java variable in javascript code on JSP page?

    How can we use java variable in javascript code on JSP page?
    Pls help

    Think about it:
    JSP/Java is executed on the Server and produces HTML+JavaScript.
    Then that HTML+JavaScript is transfered to the client. The client now interpretes the HTML+JavaScript.
    Obviously there's no way to access a Java variable directly from JavaScript.
    What you can do, however, is write out some JavaScript that creates a JavaScript variable containing the value of your Java variable.

  • Inserting asp dynamic content into javascript code

    I am inserting the following javascript text scroller code
    into my page. As you will see, each line of text to be displayed on
    the scroller is preceded with fcontent[0], fcontent[1] etc.
    Since the text will be populated by a database field with a
    repeat region applied, how do I get the fcontent[0] to increase in
    value with each repeated record?
    Secondly, will the javascript code support the mix of asp
    code as well?
    var fcontent=new Array();
    begintag='<div style="font: normal 14px Arial; padding:
    5px;">'; //set opening tag, such as font declarations
    fcontent[0]="<b>What\'s new?</b><br>New
    scripts added to the Scroller category!<br><br>The
    MoreZone has been updated. <a
    href='../morezone/index.htm'>Click here to visit</a>";
    fcontent[1]="Dynamic Drive has been featured on Jars as a top
    5% resource, and About.com as a recommended DHTML destination.";
    fcontent[2]="Ok, enough with these pointless messages. You
    get the idea behind this script.</a>";
    closetag='</div>';

    Try this
    use eval() to evaluate your code stored in the variable.
    http://uk2.php.net/manual/en/function.eval.php
    but Chances are tiny mce is encoding the php as html and i am not sure if addt will also be html encoding it it as well, so you need to check in the database if the text is encoded or escaped in some fasion. dont use tiny mce to insert the code just use a normal text area field and if addt is html encoding then you will have to use addt html de encode function to reverse what ever addt may have done to it.

  • Pass a Java Bean into Javascript function.

    Good day. Please help urgent :
    I am trying to pass an instance of MyBean class into a javascript function
    This code is added to the form.
         private String getJavaScriptForLaunchNewComponent()
              StringBuffer sb = new StringBuffer();
              sb.append("<SCRIPT language='JavaScript'>");
              sb.append("    function testFunction(zBean) { ");
              sb.append("popAssetWinSpecs = \"left=250,top=250,width=300,height=300,scrollbars=no,toolbar=no,menubar=no,resizable=no,status=no,titlebar=no,location=no\";");
    sb.append("htmlfile=\"/irj/servlet/prt/portal/prtroot/com.roche.mss.pdf.comp.PDFLauncher?zBean=\"+zBean;");
    sb.append("window.open(htmlfile,\"editWindow\",popAssetWinSpecs);");
    sb.append("return false;");
    sb.append("    }");
    sb.append("</SCRIPT>");
    return sb.toString();
    This code is set in the create component meth
         private Component buildLink(){
              GridLayout grid = new GridLayout(1,1);
              grid.setCellSpacing(5);
              TestBean zBean = new TestBean();
              zBean.setValue("Me Now");
              Link link = new Link("myLink");
              link.addText("Print PDF");
              link.setOnClientClick("testFunction("+zBean +")");
              grid.addComponent(1,1,link);
              return grid;
    Is this possible ????
    Thanks.

    solved it. Thanks

  • Executing java method into javascript

    Hi guys, have a .jsp and I'm trying to call a metod in a class (DBCombo.class), but nothing happens in fact de <% %> simbols don't change to color red.
    Is it posible to execute, assign values from javascript to java?
    <script>
    <!--
    function fFillCmbHerr(){
    if (document.frmEmpCan.cmbHerr.value == 'xx')
    <% sHerrSelCmb=db.getSistOpeCmb();%>
    -->     
    </script>
    Thanx

    I think you are addressing the wrong Forum. Go to http://forum.java.sun.com/index.jsp and select a forum more closely related to your question.
    Jane

  • How to embed URL of deployed java servlet into Android code

    I have deployed my servlet code on cloud which access the database cloud , but when i try to access the URL of deployed application , it asks for my credentials (username and password)....
    Now that i want to embedd my servlet link on cloud to my android app code , how to escape the credentials , or is their any way so that i can add my username and password in my servlet code itself. This is my servlet code and it is working fine..
    Context ctx = null;
            Hashtable ht = new Hashtable();
            ht.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
            Connection conn = null;
            Statement stmt = null;
            ResultSet rs = null;
            // out.print("system");
            try {
                ctx = new InitialContext(ht);
                javax.sql.DataSource ds = (javax.sql.DataSource) ctx.lookup("javatrial5196db");
              //  out.print(ds.toString());
                conn = ds.getConnection();
                stmt = conn.createStatement();
                rs = stmt.executeQuery("select * from test");
                while (rs.next()) {
                    out.println(rs.getString("id") + "   " + rs.getString("password") + "<br>");
                conn.close();
                stmt.close();
            } catch (Exception e) {
                out.print(e);

    What is the intended behavior here, how will the user be authenticated if credentials are not obtained from the user ? By default the JCS applications will be secured and the system will prompt for login, you can disable the login by adding "<login-config/>". You can also configure the authentication to use BASIC / FORM authentication instead. Hard coding credentials to servlet / DB table does not sound like a good solution to me though.. For details on security refer to this document.
    Jani Rautiainen
    Fusion Applications Developer Relations
    https://blogs.oracle.com/fadevrel/

  • How to fine vendor specific error code in JDBC?

    Hi all,
    Is there any method which can be used to find vendor specific error code?
    Thnx in advance

    try{
    // your code
    catch(java.sql.SQLException ex){
    int code = ex.getErrorCode() ;
    Retrieves the vendor-specific exception code for this SQLException object.
    String state = ex.getSQLState() ;
    Retrieves the SQLState for this SQLException object.
    }

  • Javascript code missing when inserting Fireworks html into DW document

    I tried to insert fireworks html in a Dreamweaver file. After importing the fireworks html in the Dreamweaver document, the associated Javascript code was missing.
    Of course, the Fireworks html file includes the Javascript code and works properly. It is just that when I insert the Fireworks html into the Dreamweaver file, the associated Javascript code gets lost although the manual clearly says that fireworks html is inserted "along with its associated images, slices, and JavaScript".
    I use Fireworks CS5 and Dreamweaver CS5, but I also tried it using FW CS4 and DW CS4 which did not solve the problem.
    I tried two ways to insert the html code (both with the same negative result):
    1.) using the DW menu: Insert > Image Objects > Fireworks HTML
    2.) Copying the HTML to the clipboard in Fireworks, and then pasting it into the Dreamweaver document
    The Fireworks and the Dreaweaver files are both HTML4 docs.
    Of course, I could insert the Javascript code manually, but then I would have to detach the associated template from the DW doc, and I would rather not do that because then later updates to the site will become more complicated.
    BTW, I also tried to insert the fireworks html in another Dreamweaver document not using any template, but the JavaScript code got lost though.
    I would be very grateful if somebody had an idea how to solve this  problem.
    Many thanks for your help!
    Siria
    Message was edited by: SiriaW

    Dear Murray,
    I believe you can solve your problem by changing this -
    </head>
    to this -
    <!-- #BeginEditable "head" --><!-- #EndEditable -->
    </head>
    by editing this template directly.
    I tried this, but it did not change anything. As I wrote before, the JavaScript code is not even inserted when I use a "blank", not-template-controlled DW page.
    But nevertheless, your hint is very helpful. By making the complete head editable, I can at least insert the Javascript code manually.
    But is the javascript that is currently shown there part of the FW HTML insertion?  Do you want to preserve that on the child pages?
    It belongs to the template. And yes, I want to preserve it on the child pages. I just want to insert this into the head of the child page:
    function MM_swapImage() { //v3.0
      var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
       if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
    Maybe we should see the FW code you are trying to insert?
    Sure. Here is the code I tried to insert (of course, most of the Java Script does not need to be inserted as it is already in the template):
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <!-- saved from url=(0014)about:internet -->
    <html>
    <head>
    <title>example.jpg</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <!--Fireworks CS5 Dreamweaver CS5 target.  Created Wed Jul 21 00:26:08 GMT+0800 (Malay Peninsula Standard Time) 2010-->
    <script language="JavaScript">
    <!--
    function MM_findObj(n, d) { //v4.01
      var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
        d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
      if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
      for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
      if(!x && d.getElementById) x=d.getElementById(n); return x;
    function MM_swapImage() { //v3.0
      var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
       if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
    function MM_nbGroup(event, grpName) { //v6.0
    var i,img,nbArr,args=MM_nbGroup.arguments;
      if (event == "init" && args.length > 2) {
        if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
          img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
          if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
          nbArr[nbArr.length] = img;
          for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
            if (!img.MM_up) img.MM_up = img.src;
            img.src = img.MM_dn = args[i+1];
            nbArr[nbArr.length] = img;
      } else if (event == "over") {
        document.MM_nbOver = nbArr = new Array();
        for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
          if (!img.MM_up) img.MM_up = img.src;
          img.src = (img.MM_dn && args[i+2]) ? args[i+2] : ((args[i+1])?args[i+1] : img.MM_up);
          nbArr[nbArr.length] = img;
      } else if (event == "out" ) {
        for (i=0; i < document.MM_nbOver.length; i++) { img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
      } else if (event == "down") {
        nbArr = document[grpName];
        if (nbArr) for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
        document[grpName] = nbArr = new Array();
        for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
          if (!img.MM_up) img.MM_up = img.src;
          img.src = img.MM_dn = (args[i+1])? args[i+1] : img.MM_up;
          nbArr[nbArr.length] = img;
    function MM_preloadImages() { //v3.0
      var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
        var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
        if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
    //-->
    </script>
    </head>
    <body bgcolor="#ffffff" onLoad="MM_preloadImages('example_bilder/example_r2_c2_s2.jpg','example_bilder/example_r2 _c2_s3.jpg','example_bilder/example_r1_c4_s1.jpg','example_bilder/example_r4_c2_s2.jpg','e xample_bilder/example_r4_c2_s3.jpg','example_bilder/example_r1_c4_s2.jpg','example_bilder/ example_r6_c2_s2.jpg','example_bilder/example_r6_c2_s3.jpg','example_bilder/example_r1_c4_ s3.jpg','example_bilder/example_r8_c2_s2.jpg','example_bilder/example_r8_c2_s3.jpg','examp le_bilder/example_r1_c4_s4.jpg','example_bilder/example_r10_c2_s2.jpg','example_bilder/exa mple_r10_c2_s3.jpg','example_bilder/example_r1_c4_s5.jpg');">
    <table style="display: inline-table;" border="0" cellpadding="0" cellspacing="0" width="915">
    <!-- fwtable fwsrc="lebenslauf_inhalt_slices_optimiert.png" fwpage="Page 1" fwbase="example.jpg" fwstyle="Dreamweaver" fwdocid = "742308039" fwnested="1" -->
      <tr>
       <td><img name="example_r1_c1_s1" src="example_bilder/example_r1_c1_s1.jpg" width="58" height="274" border="0" alt=""></td>
       <td><table style="display: inline-table;" align=""left" border="0" cellpadding="0" cellspacing="0" width="195">
          <tr>
           <td><img name="example_r1_c2_s1" src="example_bilder/example_r1_c2_s1.jpg" width="195" height="68" border="0" alt=""></td>
          </tr>
          <tr>
           <td><a href="javascript:;" onMouseOut="MM_nbGroup('out');" onMouseOver="MM_nbGroup('over','example_r2_c2_s1','example_bilder/example_r2_c2_s2.jpg',' example_bilder/example_r2_c2_s3.jpg',1);" onClick="MM_nbGroup('down','navbar1','example_r2_c2_s1','example_bilder/example_r2_c2_s3. jpg',1);MM_swapImage('example_r1_c4_s1','','example_bilder/example_r1_c4_s1.jpg',1);"><img name="example_r2_c2_s1" src="example_bilder/example_r2_c2_s1.jpg" width="195" height="16" border="0" alt=""></a></td>
          </tr>
          <tr>
           <td><img name="example_r3_c2_s1" src="example_bilder/example_r3_c2_s1.jpg" width="195" height="14" border="0" alt=""></td>
          </tr>
          <tr>
           <td><a href="javascript:;" onMouseOut="MM_nbGroup('out');" onMouseOver="MM_nbGroup('over','example_r4_c2_s1','example_bilder/example_r4_c2_s2.jpg',' example_bilder/example_r4_c2_s3.jpg',1);" onClick="MM_nbGroup('down','navbar1','example_r4_c2_s1','example_bilder/example_r4_c2_s3. jpg',1);MM_swapImage('example_r1_c4_s1','','example_bilder/example_r1_c4_s2.jpg',1);"><img name="example_r4_c2_s1" src="example_bilder/example_r4_c2_s1.jpg" width="195" height="16" border="0" alt=""></a></td>
          </tr>
          <tr>
           <td><img name="example_r5_c2_s1" src="example_bilder/example_r5_c2_s1.jpg" width="195" height="15" border="0" alt=""></td>
          </tr>
          <tr>
           <td><a href="javascript:;" onMouseOut="MM_nbGroup('out');" onMouseOver="MM_nbGroup('over','example_r6_c2_s1','example_bilder/example_r6_c2_s2.jpg',' example_bilder/example_r6_c2_s3.jpg',1);" onClick="MM_nbGroup('down','navbar1','example_r6_c2_s1','example_bilder/example_r6_c2_s3. jpg',1);MM_swapImage('example_r1_c4_s1','','example_bilder/example_r1_c4_s3.jpg',1);"><img name="example_r6_c2_s1" src="example_bilder/example_r6_c2_s1.jpg" width="195" height="17" border="0" alt=""></a></td>
          </tr>
          <tr>
           <td><img name="example_r7_c2_s1" src="example_bilder/example_r7_c2_s1.jpg" width="195" height="14" border="0" alt=""></td>
          </tr>
          <tr>
           <td><a href="javascript:;" onMouseOut="MM_nbGroup('out');" onMouseOver="MM_nbGroup('over','example_r8_c2_s1','example_bilder/example_r8_c2_s2.jpg',' example_bilder/example_r8_c2_s3.jpg',1);" onClick="MM_nbGroup('down','navbar1','example_r8_c2_s1','example_bilder/example_r8_c2_s3. jpg',1);MM_swapImage('example_r1_c4_s1','','example_bilder/example_r1_c4_s4.jpg',1);"><img name="example_r8_c2_s1" src="example_bilder/example_r8_c2_s1.jpg" width="195" height="16" border="0" alt=""></a></td>
          </tr>
          <tr>
           <td><img name="example_r9_c2_s1" src="example_bilder/example_r9_c2_s1.jpg" width="195" height="15" border="0" alt=""></td>
          </tr>
          <tr>
           <td><a href="javascript:;" onMouseOut="MM_nbGroup('out');" onMouseOver="MM_nbGroup('over','example_r10_c2_s1','example_bilder/example_r10_c2_s2.jpg' ,'example_bilder/example_r10_c2_s3.jpg',1);" onClick="MM_nbGroup('down','navbar1','example_r10_c2_s1','example_bilder/example_r10_c2_s 3.jpg',1);MM_swapImage('example_r1_c4_s1','','example_bilder/example_r1_c4_s5.jpg',1);"><i mg name="example_r10_c2_s1" src="example_bilder/example_r10_c2_s1.jpg" width="195" height="16" border="0" alt=""></a></td>
          </tr>
          <tr>
           <td><img name="example_r11_c2_s1" src="example_bilder/example_r11_c2_s1.jpg" width="195" height="67" border="0" alt=""></td>
          </tr>
        </table></td>
       <td><img name="example_r1_c3_s1" src="example_bilder/example_r1_c3_s1.jpg" width="69" height="274" border="0" alt=""></td>
       <td><img name="example_r1_c4_s1" src="example_bilder/example_r1_c4_s1.jpg" width="539" height="274" border="0" alt=""></td>
       <td><img name="example_r1_c5_s1" src="example_bilder/example_r1_c5_s1.jpg" width="54" height="274" border="0" alt=""></td>
      </tr>
    </table>
    </body>
    </html>

  • Load CF varibales into javascript array without outputing to source code

    I have a javascript array for dynamic dropdowns - Automobile, makes,models, etc.
    The javascript arrays are populated by by cf queries
    Everythign works and functions fine - but it also loads the entire array (hundreds of lines of code) into the browser source code.
    I would like to have the javascript arrays hidden from the browser source code by calling it:
    <script language="JavaScript" type='text/javascript' src='../js/super.js'></script>
    But when I code like this, the js file 'super.js' does not run the cf variables.
    The only way I can get it to function right now is to save a cf file called 'super.cfm' and have it run the cf query, then list the javascript code under the query on this cf template.
    THis works - but again, it causes the entire javascript code to be visible to the browser source code...
    any ideas? - I am on cf 7
    thanks in advance

    thanks for your idea
    I ended up rethinking the whole process and realized that I only update my vehicle make/model list about once a week
    So what I ended up doing was creating the the dynamic javascript arrays through cf - and rendered them in a browser, then took the browser source code (the fully rendered javascript arrays) and saved them as a static js file
    My website uses this js file on every page, so I no longer need to call queries on every single page to populate the javascript arrays - they are already built and I am guessing cached by the browser  (browsers cache js files right?)
    SO this runs more efficiently.
    The only draw back is that when I add a new vehicle to the list in my database, I will need to manually do the same process of rendering the new js code, then cutting and pasting it into my static js file that gets called by all pages.
    So it loses the realtime updates - but this only happened once a week anyway - and it only takes me five minutes to create the new file.
    We'll see if I get sick of manually creating a new js file each week - probably, but this seems better than making the server re-render the code on each page.
    Does this make sense? - would this be less overhead on the server than implimenting your concept?
    thanks.

  • JSP response into a Javascript code

    Suppose I have a form that I submit, and its action is set to a JSP page that returns a series of elements <option>, for example:
        <option>2005</option>
        <option>2006</option>
    Is it possible to GET that JSP response, inside the JavaScript code?
    Or should I better state, inside the JSP code, to return ONLY the numbers and then I get it on the JavaScript and use the .add() funtion to add the item to a <select> ?
    How do I save that response inside the JavaScript?
    For example, I am trying with this Javascript function that handles the changes on a drop-down list:
      function clickedOnPType(lista)
      document.form1.action = "searchAvailableYears.jsp?pType=" + txtPType;}
      document.form1.submit();
    }...And I am getting, in return, a series of <option> with the correct data...
    Thanking you in advance,
    MMS

    Oh hello... in one of my 1000 searches I found that
    post days ago and I was already trying with your
    code, but I was getting several errors like
    "undefined is null or not an object" (in IE),
    "xmlhttp.responseXML has no properties" (in
    Firefox).... Well one thing i wanted to discuss here is is wat properties does in general a XmlHttpRequest Object contains
    checkout the below interface which gives a clear understanding of the Object member properties.
    interface XMLHttpRequest {
      attribute EventListener   onreadystatechange;
      readonly attribute unsigned short  readyState;
      void  open(in DOMString method, in DOMString url);
      void  open(in DOMString method, in DOMString url, in boolean async);
      void  open(in DOMString method, in DOMString url, in boolean async, in DOMString user);
      void  open(in DOMString method, in DOMString url, in boolean async, in DOMString user, in DOMString password);
      void  setRequestHeader(in DOMString header, in DOMString value);
      void  send();
      void  send(in DOMString data);
      void  send(in Document data);
      void  abort();
      DOMString  getAllResponseHeaders();
      DOMString  getResponseHeader(in DOMString header);
      readonly attribute DOMString  responseText;
      readonly attribute Document   responseXML;
      readonly attribute unsigned short  status;
      readonly attribute DOMString  statusText;
    };therefore as you can see XmlHttpRequest.reponseXML returns a Document Object which has below set of properties.
    http://www.w3schools.com/dom/dom_document.asp
    http://www.javascriptkit.com/domref/documentproperties.shtml
    and as said earlier one can send AJAX response in three ways
    1).Plain text(with comma seperated values maybe): Which we can collect using XmlHttpRequest.responseText 2).XML: @ client side XmlHttpRequest.reponseXML create a DOM Object using which one can parse it get values
    of attributes and values of different tags and then update the view accordingly.
    3).JSON(Javascript Object Notation): It is a bit complicated thing to discuss at this moment
    however it uses the first property(Plain text) and then
    uses set of libraries to parse and update the view.
    checkout below links to understand it
    http://www.ibm.com/developerworks/library/j-ajax2/
    http://oss.metaparadigm.com/jsonrpc/
    >  function handleOnChange(ddl)
    >
    var ddlIndex = ddl.selectedIndex;
    var ddlText = ddl[ddlIndex].text;
    var frmSelect = document.forms["form1"];
    var frmSelectElem = frmSelect.elements;
    if(ddl.name="pType")
         txtYear = "";
    txtDay = "";
              txtTime = "";
              unblock(document.form1.year);
              block(document.form1.day);
              block(document.form1.time1);
         laProxLista = frmSelectElem["year"];
    if (ddl.options[ddl.selectedIndex].text !=
    txtPType = ddl.options[ddl.selectedIndex].text;
    else if(ddl.name="year")
         txtDay="";
         txtTime="";
              unblock(document.form1.day);
              block(document.form1.time1);
    laProxLista = frmSelectElem["day"];
    f (ddl.options[lista.selectedIndex].text != "---")
    txtYear = ddl.options[lista.selectedIndex].text;
    else if(ddl.name="day")
    {          txtTime = "";
              unblock(document.form1.time1);
    laProxLista = frmSelectElem["time1"];
    (ddl.options[ddl.selectedIndex].text != "---")
    txtDay = ddl.options[ddl.selectedIndex].text;
    else //time1
    laProxLista = null;
    if (ddl.options[ddl.selectedIndex].text != "---")
    txtTime1 = ddl.options[ddl.selectedIndex].text;
    if ( txtPType != "---")
    xmlhttp = null
    // code for initializing XmlHttpRequest
    Object On Browsers like Mozilla, etc.
    if (window.XMLHttpRequest){ 
    xmlhttp = new XMLHttpRequest()
    // code for initializing XmlHttpRequest
    Object On Browsers like IE
    else if (window.ActiveXObject) { 
    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP")
    if (xmlhttp != null)
    if(ddl.name = "pType")
    // Setting the JSP/Servlet url to get
    XmlData
    url = "searchAvailableYears.jsp?pType="
    + txtPType;
                   else if(ddl.name = "year")
    url = "searchAvailableDOY.jsp?pType=" + txtPType
    PType + "&year=" + txtYear;
                   else(ddl.name = "day")
    url = "searchAvailableTimes.jsp?pType=" +
    e=" + txtPType + "&year=" + txtYear + "&day=" +
    txtDay;
    xmlhttp.onreadystatechange =
    handleHttpResponse;
    // Open the Request by passing Type of
    Request & CGI URL
    xmlhttp.open("GET",url,true);
    // Sending URL Encoded Data
    xmlhttp.send(null);
    else{
    // Only Broswers like IE 5.0,Mozilla & all other
    browser which support XML data Supports AJAX
    Technology
    // In the Below case it looks as if the
    browser is not compatiable
    alert("Your browser does not support
    XMLHTTP.")
    } //else
    } //if chosen
    //function
         //----------------------------Well as far as i can see i do not have any issues with it because your code looks
    preety much involved with your business logic but one thing i would like to reconfim
    here is the variable "xmlhttp" a global one.
    if no declare xmlhttp variable as a global variable.
    <script language="javascript">
    var xmlhttp;
    function handleOnChange(ddl){
    function verifyReadyState(obj){
    function handleHttpResponse() {
    </script>
    > function verifyReadyState(obj)
    if(obj.readyState == 4){
    if(obj.status == 200){
    if(obj.responseXML != null)
    return true;
    else
    return false;
    else{
    return false;
    } else return false;
    }I believe,this is preety much it.
    > function handleHttpResponse() [/b]
    if(verifyReadyState(xmlhttp) == true)
    //-----------HERE!! ---- I GET "UNDEFINED" IN THE
    DIALOG BOX
    //------- BELOW THE CODE LINE....---
    var response = xmlhttp.responseXML.responseText;
    alert(response);
    it is obvious that you would get Undefined here as responseText is not a property of Document Object or to be more specific to the Object what xmlhttp.responseXML returns.
    you might have to use that as alert(xmlhttp.responseText);
    and coming back to parsing the XML reponse you have got from the server we need to use
    var response = xmlhttp.responseXML.documentElement; property for it...
    and if you put as a alert message it has to give you an Output like"Object"
    alert(response);
    if that doesn't the browser version which you are using may not support XML properly.
    var response = xmlhttp.responseXML.documentElement;
    removeItems(laProxLista);
    var x = response.getElementsByTagName("option")
      var val
      var tex
      var newOption
                  for(var i = 0;i < x.length; i++){
                     newOption = document.createElement("OPTION")
                     var er
                     // Checking for the tag which holds the value of the Drop-Down combo element
                     val = x.getElementsByTagName("value")
    try{
    // Assigning the value to a Drop-Down Set Element
    newOption.value = val[0].firstChild.data
    } catch(er){
    // Checking for the tag which holds the Text of the Drop-Down combo element
    tex = x[i].getElementsByTagName("text")
    try{
    // Assigning the Text to a Drop-Down Set Element
    newOption.text = tex[0].firstChild.data
    } catch(er){
    // Adding the Set Element to the Drop-Down
    laProxList.add(newOption);
    here i'm assuming that i'm sending a xml reponse of format something below.
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <drop-down>
       <option>
            <value>1</value>
            <text>label1</text>
       </option>
       <option>
            <value>2</value>
            <text>label2</text>
       </option>
       <option>
            <value>3</value>
            <text>label3</text>
       </option>
    </drop-down>and i'm trying to update both option's value and label which would be something like
    <select >
    <option value="1">label1</option>
    <option value="2">label2</option>
    <option value="3">label3</option>
    <option value="4">label4</option>
    </select>else where if you are interested in getting a format like the one below
    <select >
    <option>label1</option>
    <option>label2</option>
    <option>label3</option>
    <option>label4</option>
    </select> try the below snippet
    var response = xmlhttp.responseXML.getElementsByTagName("text");
    var length = response.length;
    var newOption
    for(var i =0 ; i < length;i++){
       newOption = this.document.createElement("OPTION");
       newOption.text = response.childNodes[0].nodeValue;
    // or newOption.text = response[i].firstChild.data
    laProxList.add(newOption);
    Another thing...
    I have tried to set the content type inside the JSP
    to
    response.setContentType("text/html");
    AND to
    response.setContentType("text/xml");
    but none of the above is getting me results......use of response.setContentType("text/xml"); is more appropriate here.. as you are outputting XML or a plain text here...
    make sure you set the reponse headers in the below fashoin while outputting the results....
    response.setContentType("text/xml");
    response.setHeader("Pragma", "no-cache");
    response.setHeader("Cache-Control", "no-cache");
    response.setDateHeader("Expires", 1);
    response.setDateHeader("max-age", 0); and if you are serious about implementing AJAX i would advice you start learn basics of XmlHttpRequest Object and more about DOM parsing is being implemented using javascript.
    http://www.w3.org/TR/XMLHttpRequest/#xmlhttprequest0
    http://www.jibbering.com/2002/4/httprequest.html
    http://java.sun.com/developer/technicalArticles/J2EE/AJAX/
    http://developer.apple.com/internet/webcontent/xmlhttpreq.html
    http://www.javascriptkit.com/domref/documentproperties.shtml
    and then go about trying different means of achieving them using simpler and cool frameworks
    like DWR,dojo,Prototype,GWT,Jmaki,Back Base 4 Struts,Back Base 4 JSF....etc and
    others frameworks like Tomahawk,Ajax4Jsf,ADF Faces,ICE FACES and many others which work with JSF.
    Please Refer
    http://swik.net/Java+Ajax?popular
    http://getahead.org/blog/joe/2006/09/27/most_popular_java_ajax_frameworks.html
    Hope that might help :)
    and finally an advice before implementing anything specfic API which may be related to any technologies (JAVA,javascript,VB,C++...) always refer to API documentation first which always gives you an Idea of implementing it.
    Implementing bad examples posted by people(even me for that matter) directly doesn't make much sense as that would always lands you in trouble.
    and especially when it is more specific to XmlHttpRequest always make habit of refering
    specific Browser site to know more about why specific Object or its property it not working 4i
    IE 6+: http://msdn2.microsoft.com/en-us/library/ms535874.aspx
    MOZILLA: http://developer.mozilla.org/en/docs/XMLHttpRequest
    Safari: http://developer.apple.com/internet/webcontent/xmlhttpreq.html
    Opera 9+: http://www.opera.com/docs/specs/opera9/xhr/
    Hope there are no hard issues on this...
    REGARDS,
    RaHuL

  • How to pass a jsp variable into javascript??

    <p><%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
    <p><%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
    <p><html>
    <p><c:set var="binrmapi" value="http://localhost/paas-api/bingorooms.action;jsessionid=XXXXXX?userId=TEST2&sessionId=1&key=1" />
    <p><c:import var="testbinrm" url="${fn:replace(binrmapi, 'XXXXXX', jsessionid)}"/>
    <p><c:set var="tuples" value="${fn:split(testbinrm, '><')}" />
    <p>Time until next game
    <p><c:forEach var="tuple" items="${tuples}">
    <p><c:if test="${fn:contains(tuple, 'row ')}">
    <p> <p><code>
    <p> <c:set var="values" value="${fn:split(tuple, '=\"')}" />
    <p> <font color="blue">
    <p> <c:out value="${values[17]}" />
    <p><c:set var="remainingtime" value="${values[17]}" />
    <p> </font>
    <p> </code>
    <p></c:if>
    <p></c:forEach>
    <p><form name="counter"><input type="text" size="8" name="d2"></form>
    <p><script>
    <p>var milisec=0
    <p>var seconds=eval("document.myForm.remaining").value;
    <p>function display(){
    <p> if (milisec<=0){
    <p> milisec=9
    <p> seconds-=1
    <p>}
    <p>if (seconds<=-1){
    <p> milisec=0
    <p> seconds+=1
    <p> }
    <br>else
    <p> milisec-=1
    <p> document.counter.d2.value=seconds+"."+milisec
    setTimeout("display()",100)
    <p>}
    <p>display()
    <p></script>
    <p></body>
    <p></html>
    <p>This is my code that i was working on, in the jsp part of the script, i get a api call and save a value of time in the variable remainingtime.. and in the javascript, i try to have a countdown clock counting down the remaining time.. but i guess it doesnt work.. how can i get that working? thanks alot
    Message was edited by:
    hamham3001
    Message was edited by:
    hamham3001
    Message was edited by:
    hamham3001
    Message was edited by:
    hamham3001

    Re: How to pass a jsp variable into javascript??Here is the sameple one, hope it will solves your problem.
    <html>
    <body>
    <form name=f>
    <%!
    String str = "A String"
    %>
    <script>
    var avariable = <%=str%>
    <script>
    </form>
    </body>
    </html>
    Let me know if you face any problem

  • Java Applet to Javascript Communication

    There is a Java Applet which digitally signs files after taking
    private key from a smart card.This applet takes external files.
    I want to do this "Generate digital signature of a web page with the
    help of an applet of which the applet is itself a part"
    I am trying using Java Applet to Javascript Communication.
    I am able to access the object which represents the HTML document.
    That abject is represented by document itself.
    Now I have to somehow generate the whole webpage i.e. like we view in a
    notepad like this:
    <HTML>
    <Title>my page</title>
    Then write into a file and then that file can be signed.
    This is what I feel.
    In C#.net there is a method .innerhtml.
    Does such kind of a method exists in Java.???
    I m searching but cudn't get till now.
    Will serialization work??

    Kindly forget the previous post. Read the following:
    JSObject browserWindow = JSObject.getWindow(this);
    JSObject doc = (JSObject)browserWindow.getMember("document");
    Here doc represents the object of the HTML document.
    This is accessed using Java Applet JavaScript Communication.
    I want to serialize the object represented by doc.
    Then write it into a file and generate it's digital signature.
    In the below written line the parameter fileName is passed.
    CertificationChainAndSignatureBase64 signingResult = signFile(fileName);
    For this I have added few lines in the code written below.
    see first 10-30 lines. Though this code gets compiled but it is not running. When I want to sign the file , it throws an error
    "Unexpected error:sun.plugin.javascript.ocx.JSObject"
    This code is just one class. Two other classes are needed to completely test the code.
    Should I post them ??
    Kindly see what is the error.
    I will be highly grateful and Sorry for confusing in the previous mail...
    private void signSelectedFile() {
    try {
    // Get the file name to be signed from the form in the HTML document
    JSObject browserWindow = JSObject.getWindow(this);
    JSObject mainForm = (JSObject) browserWindow.eval("document.forms[0]");
    String fileNameFieldName = this.getParameter(FILE_NAME_FIELD_PARAM);
    JSObject fileNameField = (JSObject) mainForm.getMember(fileNameFieldName);
    //This is another modification
    //String fileName = (String) fileNameField.getMember("value");
                   //here we get the document......
    JSObject doc = (JSObject)browserWindow.getMember("document");
    //String docum = doc.toString();
    String thePage = "as";
                   FileOutputStream out = new FileOutputStream(thePage);
                   ObjectOutputStream s = new ObjectOutputStream(out);
                   s.writeObject(doc);
                   String fileName = thePage;
                   JOptionPane.showMessageDialog(this, fileName); //"Unexpected error: " + e.getMessage());
    // Perform the actual file signing
    CertificationChainAndSignatureBase64 signingResult = signFile(fileName);
    if (signingResult != null) {
    // Document signed. Fill the certificate and signature fields
    String certChainFieldName = this.getParameter(CERT_CHAIN_FIELD_PARAM);
    JSObject certChainField = (JSObject) mainForm.getMember(certChainFieldName);
    certChainField.setMember("value", signingResult.mCertificationChain);
    String signatureFieldName = this.getParameter(SIGNATURE_FIELD_PARAM);
    JSObject signatureField = (JSObject) mainForm.getMember(signatureFieldName);
    signatureField.setMember("value", signingResult.mSignature);
    } else {
    // User canceled signing
    catch (DocumentSignException dse) {
    // Document signing failed. Display error message
    String errorMessage = dse.getMessage();
    JOptionPane.showMessageDialog(this, errorMessage);
    catch (SecurityException se) {
    se.printStackTrace();
    JOptionPane.showMessageDialog(this,
    "Unable to access the local file system.\n" +
    "This applet should be started with full security permissions.\n" +
    "Please accept to trust this applet when the Java Plug-In ask you.");
    catch (JSException jse) {
    jse.printStackTrace();
    JOptionPane.showMessageDialog(this,
    "Unable to access some of the fields of the\n" +
    "HTML form. Please check the applet parameters.");
    catch (Exception e) {
    e.printStackTrace();
    JOptionPane.showMessageDialog(this, "Unexpected error: " + e.getMessage());
    }

  • Using webmail in Mozilla Firefox 17.0.1 on Windows 8, original messages get turned into html code when I reply to or forward them. How can I fix this?

    I have tried re-setting Firefox and working in Safe Mode, but the problem still recurs. I use Fastmail as my webmail server and never had this problem on Windows XP or Windows 7. When I reply to a message, the original message is turned into html code. The same happens when I forward a message.
    My JavaScript is up to date, in case that's relevant. The Fastmail support team suggested the problem would be Firefox-related.
    The other function of my Fastmail account that isn't working properly in Firefox 17.0.1. is the search function.
    Do I need to get new plugins or something? I don't know where the HTML editor is in Firefox or if that's what's wrong.
    Regards,
    Rachel

    Thanks for your reply, cor-el. Norton 360 came pre-installed on the laptop as part of the package I bought. I haven't changed the pre-set firewall or anti-virus settings. Should I change something?
    I will try rebooting in Windows Safe mode as you say and report if that makes any difference.
    Rachel

  • Several payments from one vendor into one payment order

    Hello,
    I would combine payments from one vendor into one payment order.
    I found in XK03 there is a tab in payment tab to set the voice individual payment but I cannot change it since is not an editable field.
    see image
    How can I change this?
    I need to do this change as a massive change for all vendors for a company code.
    Can you help me, please?
    Thank You

    Yes, What Harnish says is correct.
    Additional you can check in Vendor Master-Company Code Data-Payment Transactions Tab-Individual Payment
    Individual pmt should be un-ticked.
    Hope this will help you
    Regards,
    Deepak

Maybe you are looking for

  • Open new Tab error

    When i open a new TAB in mozilla firefox I always have this error: Erro na análise do XML: entidade indefinida Localização: about:newtab Número da linha 116, Coluna 47: <button class="launchButton" id="settings">&abouthome.settingsButton.label;</butt

  • Is it possible to upgrade CPU on my Satellite C

    Is it possible to upgrade my AMD E1-1200 1.4ghtz processor to anything faster than that, I want to be able to play FIFA14 apparently it drags on the current processor. My ram is 6GB and I believe it is enough.

  • How do i fix cellular data to work after updating to ios 8.0.2

    IOs8.0.2 updated and now i have no cellular data

  • Where do I get "Plot Multi-XY"?

    Hi everyone, The thing is that I need this "Plot Multi-XY" and it was mentioned in my help program as 'not available in base package'. Is there any other way that I can get hold of this Sub-VI?? P.S: Thanks VI Guy!!

  • PSE 8 Camera Raw issues

    I have Photoshop Elements 8 and I just recently started shooting in RAW, but when I try to download the files in Bridge (I have a Mac), the thumbnails don't show up.  I went ahead and tried to download the files, even though I couldn't see what they