browser compatibility

Discussion in 'Javascript' started by priyanka67, May 14, 2008.

  1. priyanka67

    priyanka67 Guest

    I have few jsps with images...but they run on internet explorer but
    when i use mozilla firefox i dint get these pages
    properly..........images dont come properly... Can anybody help??
     
    priyanka67, May 14, 2008
    #1
    1. Advertisements

  2. priyanka67

    Erwin Moller Guest

    schreef:
    Hi,

    jsps means Java Server Pages?
    If so: It doesn't matter which language created the html.
    The only thing that matters is the HTML send to your browser.

    So simply view the source, find the imagetags, and try to find out what
    is wrong.

    You might want to validate your HTML too, and make sure it is valid.
    Here: http://validator.w3.org/

    Regards,
    Erwin Moller
     
    Erwin Moller, May 14, 2008
    #2
    1. Advertisements

  3. priyanka67

    priyanka67 Guest

    ya jsp means java server pages.........
    my problem is that image comes fine on IE but on mozilla it comes only
    half..........not full image is displayed..
    my code in jsp is:
    <?xml version="1.0" encoding="UTF-8"?>

    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://
    www.w3.org/TR/html4/loose.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <script language="JavaScript" src="Login.js">
    </script>
    <!-- Linking of the Style sheet Commonstyle.css -->
    <link rel="stylesheet" type="text/css" href="../css/commonstyle.css">
    <meta http-equiv="Content-Type" content="text/html;
    charset=ISO-8859-1">
    <title>LOGIN-SNAKE AND LADDER</title>
    </head>
    <body onload="setFocus()">
    <h2><center><font face="Comic Sans MS" color="green" size=8>Snake And
    Ladder</font></center></h2>
    <h2><center><font face="Comic Sans MS" color="black"
    size=5>LOGIN</font></center></h2>
    <!-- Creating a form with name frm -->
    <form name="LoginForm" action="../LoginServlet" method="post">
    <!-- Creating a Table -->
    <table width="35%" height="45%" align="center" background=".../
    images/createGame.jpg">
    <!-- Inserting values and texfeilds and buttons into the
    table -->
    <tr>
    <td align="center">UserName<span class="mandatory">*</
    span></td>
    <td align="center"><input type="text" name="userName"
    maxlength="11" id="uName"></td>
    </tr>
    <tr>
    <td align="center">Password<span class="mandatory">*</
    span></td>
    <td align="center"> <input type="password" name="password"
    maxlength="11"></td>
    </tr>
    <tr>
    <td align="center"><input type="submit" VALUE="Submit"
    onClick="return fnLoginValidate()"></td>
    <td align="center"><input type="reset" VALUE="Reset"></td>
    </tr>

    <!--Close of table tag -->
    </table>
    <h1><center><font size="1">Fields marked with * are
    mandatory</font></center></h1>
    <a href="NewUser.jsp"><center>New User Click Here!<center></
    a>
    <!--Close of form tag -->
    </form>
    </body>

    </html>
     
    priyanka67, May 14, 2008
    #3
  4. escribió:
    You haven't followed any of Erwin's recommendations:

    - JSP is JSP, not HTML.
    - The generated HTML does not validate (14 errors so far).

    Even more, despite asking in a JavaScript group you omit the JavaScript
    code.

    I can't see any <img> tag but I've replaced the background attribute
    with an actual image and it loads fine. I suggest you go to Tools-> Page
    Properties and check paths in "Media" tab.
     
    Álvaro G. Vicario, May 14, 2008
    #4
  5. priyanka67

    Erwin Moller Guest

    schreef:
    Your keyboard seems to hang on '.'.
    (c) Pointedears

    OK, JSP it is, but we don't care: the browser doesn't care.
    It only sees the HTML generated, be it by Perl, PHP or Java.
    Does FF do this consequent? Or just sometimes?
    If it displays it ALWAYS half, chances are your jpg is not valid, or,
    since you use it as a background, maybe there isn't enough space to
    fully display it?

    I am not sure why you use an xml-tag that says UTF-8 while you instruct
    your Java environment to use ISO-8859-1.
    Not my area of expertise, but that looks strange.

    Stop using language for scripttags.
    Use this:
    Yet again the characterencoding.
    I think the header is used above the metatag, but since they are the
    same, I doubt this will be the problem.

    <snipped the rest>

    You can test if your jpg is valid, and FF can display it, by simply
    typing the full URL of your image in the URL.
    eg:
    http://www.example.com/images/createGame.jpg

    If it displays right --> your table is too small to diplay it completely.
    If it displays half --> Your jpg is probably corrupt.

    Regards,
    Erwin Moller
     
    Erwin Moller, May 14, 2008
    #5
  6. [trimmed atttribution novel]

    How did you get the idea that anyone asked you to dump core here? Acquire
    some manners or go away.

    http://jibbering.com/faq/


    PointedEars
     
    Thomas 'PointedEars' Lahn, May 14, 2008
    #6
  7. priyanka67

    Erwin Moller Guest

    Thomas 'PointedEars' Lahn schreef:
    PointedEars <-- I think I stole the 'broken keyboard' line from you.
    (I hope it was not legally protected.)

    Regards,
    Erwin Moller
     
    Erwin Moller, May 14, 2008
    #7
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.