Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 6 of 6

Thread: Code works in IE11 but not chrome or Firefox

  1. #1
    Junior Member
    Join Date
    Aug 2014
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Code works in IE11 but not chrome or Firefox

    I could not find a better spot to post this so I hope this is OK.

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
     "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    	<title>Redliner</title>
      <meta charset="utf-8">
    <script type="text/javascript">
    var _baseURL = "http://192.168.20.14:8080/emap/client/";
    var _locateURL= _baseURL + "emap.jsp";
    var _parentWindow = null;
     
     
    function doResize() {
      //used to force an applet refresh when on XP/ jvm 1.4 and user resizes window
      // document.redlinerapplet.width = parseInt(document.redlinerapplet.width) + 1;
      //  document.redlinerapplet.width = parseInt(document.redlinerapplet.width) + 1
    }
     
    /*
    Called from the RedlinerContainer in RedlinerApplet after Redliner Locate button is clicked.
    */
    function locateRedline(theExtent) {
      var theCoords = theExtent.split(",");
      if ((_parentWindow != null) && (_parentWindow.closed)) {
         openNewViewer(theCoords)
      } else if (_parentWindow == null){
        if((top.parent.opener != null) && (!top.parent.opener.closed)){
          _parentWindow = top.parent.opener.top;
    	  zoomMap(theCoords);
    	} else {
    	  openNewViewer(theCoords);
    	}
      } else {
         zoomMap(theCoords);
      }
     
    }
     
     
    function openNewViewer(theCoords) {
         var theURL = _locateURL + "?STARTLEFT=" + theCoords[0] + "&" +
                     "STARTBOTTOM=" + theCoords[1] + "&" +
                     "STARTRIGHT=" + theCoords[2] + "&" +
                     "STARTTOP=" + theCoords[3] ;
    	  _parentWindow = window.open(theURL,"","status=yes,scrollbars=no,location=yes,resizable=yes,height=600,width=800");
     
    }
     
     
     
    function zoomMap(theCoords) {
      /*
       _parentWindow.MapFrame.zoomToEnvelope(theCoords[0],theCoords[1],theCoords[2],theCoords[3]);
    	//alert("HONU is zooming to Redliner extent.");
      */
    }
     
    function closeWindow() {
      setTimeout("self.close();",2000);
    }
     
    function doLoad() {
     
    }
     
    function doUnload() {
     
    }
     
    </script>
     
    </head>
     
    <body onunload="doUnload();" onload="doLoad();" onresize="doResize();" bottommargin="0" topmargin="0" leftmargin="0" rightmargin="0">
     
     
    <object codetype="application/java" classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" align="baseline" name="redlinerapplet" width="1827" height="855" style="display:block;">
      <param name="archive" value="http://192.168.20.14:8080/emap/client/classes/redliner.jar,http://192.168.20.14:8080/emap/client/classes/jsobject.jar,http://192.168.20.14:8080/emap/client/classes/iText-5.0.0.jar" />
      <param name="code" value="com.ema.redline.client.RedlinerApplet.class" />
      <param name="redline_properties" value="http://192.168.20.14:8080/emap/client/classes/redlineclient.properties" />
      <param name="imageurl" value="http://192.168.20.14/images/redlines/rl_8435.png" />
      <param name="minx" value="280185.3765951926" />
      <param name="miny" value="238372.34460712216" />
      <param name="maxx" value="391504.8210396371" />
      <param name="maxy" value="290467.65112053213" />
      <param name="username" value="keith" />
    </object>
    </body>
    </html>

    Java does work in firefox and chrome. The plugins are working and I have another application which opens just fine. This one just doesn't seem to work. I am very new to java and I inherited this code.

    The Java console does not even come up when I go to the page. I can see the source code but the page is just blank.

    Thanks for your help

    Ray


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    SW Missouri
    Posts
    20,394
    Thanks
    49
    Thanked 2,212 Times in 2,185 Posts

    Default Re: Code works in IE11 but not chrome or Firefox

    Does the applet work with the <applet tag?


    See this: http://docs.oracle.com/javase/1.5.0/...sing_tags.html
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,085
    My Mood
    Mellow
    Thanks
    184
    Thanked 653 Times in 640 Posts

    Default Re: Code works in IE11 but not chrome or Firefox

    Thread moved. JavaScript != Java.

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    SW Missouri
    Posts
    20,394
    Thanks
    49
    Thanked 2,212 Times in 2,185 Posts

    Default Re: Code works in IE11 but not chrome or Firefox

    @Greg The page has an applet referenced with an object tag.
    If you don't understand my answer, don't ignore it, ask a question.

  5. #5
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,085
    My Mood
    Mellow
    Thanks
    184
    Thanked 653 Times in 640 Posts

    Default Re: Code works in IE11 but not chrome or Firefox

    Ah, yep, see that now. Thanks for pointing that out. Moving it back to where it was.

  6. #6
    Junior Member
    Join Date
    Aug 2014
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Code works in IE11 but not chrome or Firefox

    Sorry for posting in the wrong spot. Thanks for moving.

    I actually got it working. I had to use an embed inside the object to accommodate the different browsers. Is this the best way to accomplish this??

Similar Threads

  1. Replies: 9
    Last Post: September 15th, 2013, 02:48 PM
  2. how this code works?
    By vigneshwaran in forum What's Wrong With My Code?
    Replies: 1
    Last Post: December 11th, 2012, 08:18 AM
  3. This Works In My Other Code But Not This One?
    By Ooogel in forum What's Wrong With My Code?
    Replies: 3
    Last Post: October 5th, 2012, 05:49 PM
  4. Java Script works in IE 8 and 9 but not in Chrome
    By GAMC in forum Other Programming Languages
    Replies: 1
    Last Post: July 30th, 2012, 10:56 PM