Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8731077
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:08:59+00:00 2026-06-13T09:08:59+00:00

Am hitting a JSP page. In this JSP page, I have Jquery + Scriplets

  • 0

Am hitting a JSP page. In this JSP page, I have Jquery + Scriplets + some JSP tags (div, input, form etc) + Java Scripts.

This JSP page takes username as input from user. If user has not input his username but simply hits submit button the page will refresh and throw an error message. The page will refresh and hit the same URL (Error message is not shown in a new page)

In the process of user hitting Submit button and error message is thrown, Chrome Browser is also rendering other DIV elements in the JSP page for a flash of second and throwing the desired error message to user.

With Chrome browser rendering other elements (div, input etc) in the JSP when the same page is hit, it will give a picture of the other elements to users. This is not happening in IE and FF.

How to avoid this in Chrome?

@Alfasin:
I have attached the JSP code below. Let me know if any other details are required.

<html>
<head>
<script type="text/javascript" src="/static-files/scripts/jquery-1.6.2.js"></script>
<script type="text/javascript" src="/static-files/scripts/tooltip.js"></script>
<script type="text/javascript" src="/static-files/scripts/jquery-ui.min.js"></script>
<link href="/static-files/css/jquery-ui-rev.css" type="text/css" rel="stylesheet"/>
<%@page import="javax.servlet.http.Cookie"%>
<%
        String visitingCookie = "AUTHCookie";
        String urlCookie = "URLCookie";
    String movieCookieName="movieCookie";
        String displayOnlyPwd = "false";
        Cookie[] cookielist = request.getCookies();
        if(cookielist != null)
          {
              for(int i = 0; i<cookielist.length; i++)
               {
                  Cookie cookie = cookielist[i];
                  if(cookie.getName().contains(visitingCookie) && 
!cookie.getValue().equals(""))
                    {
                          displayOnlyPwd = "true";
                          request.setAttribute("AUTHCookie",cookie.getValue());
                          request.setAttribute("displayOnlyPwd",displayOnlyPwd);
                          break;
                   }
              }
        if(displayOnlyPwd.contains("false"))
        {
            request.setAttribute("displayOnlyPwd",displayOnlyPwd);
        }
       }
    else{
        displayOnlyPwd = "false";
        request.setAttribute("displayOnlyPwd",displayOnlyPwd);
    }
%>
<script type="text/javascript">
$(function() {
    $("#toopt a").tooltip({
    bodyHandler: function() {
        return $($(this).attr("href")).html();
    },
 });
   });

function delete_cookie ( cookie_name )
{
  var cookie_date = new Date ( );  
  cookie_date.setTime ( cookie_date.getTime() - 1 );
  document.cookie = cookie_name += "=; expires=" + cookie_date.toGMTString();
}

function checkpassword() 
{
var checkPassword=document.getElementById("password").value;
var counter=0;
var errMsg=" ";
var errMsg1=" ";

    if(checkPassword.length==0)
        {

         errMsg+="Please enter a valid Password.";
                     document.writeln("<form name=\"errForm\" method=\"POST\" action=\"http://myDomain/web/portal/home/-/portal/login?_58_redirect=%2Fweb%2Fportal%2Flogout\">");
         document.writeln("<input type=\"hidden\" name=\"errMsg\" value=\"" + errMsg + "\">");
         document.writeln("</form>");
         document.errForm.submit(); 
         return false;
            }

}
function enableDisableForm(myVar)
{
if(myVar == "true")
{
$(document).ready(function()
            {
            $("#disableDivForm").dialog({
         autoOpen:true,
     position:'center',
        height:167,
        width: 472,
        modal: true

            });
            });



var div1 = document.getElementById("enableDivForm");
div1.style.display = "none";


}
else
{


var div2 = document.getElementById("disableDivForm");
div2.style.display = "none";
 }
}
</script>
</head>

I have pasted 50% of my code here. Another 50% to go. Do you require me to paste full code?

Regards,

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T09:09:00+00:00Added an answer on June 13, 2026 at 9:09 am

    upload the body with the attribute:
    "style= display: none;"

    and only after you’ve done with uploading the page (as the last command in ready function if you’re using jQuery) do:

    $("#body).show();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

hitting a road block on this. what I have so far: <input id=newFile type=file/>
I have a view Search.jsp that has a form:form that is connected to a
I have been hitting a dead end with this program. I am trying to
If I am hitting www.foo.com and am writing some cookies there, will I have
My java program is hitting http://url:port kind of url to fetch some data. On
I have some ad-hoc reporting users hitting some SQL Server views. Occasionally the read
I'm hitting a wall in an android SQL query, this is what I have
I am hitting this error when implementing core data. I have created a entity
I'm hitting a wall with this, currently I have two web-service endpoints configured and
I have a jsp page which has dynamic includes. each dynamic include invoke its

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.