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

  • SEARCH
  • Home
  • 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 5969243
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:12:08+00:00 2026-05-22T20:12:08+00:00

I am getting document.getElementById(#toHide) is null. How can solve this? how to convert this

  • 0

I am getting document.getElementById("#toHide") is null. How can solve this? how to convert this statement to jquery?

html:

<form wicket:id="safeForm" class="clearfix" />
<div id="toHide" class="pb-text-align-center">
<img id="loadingImg" src="my image location" style="margin-left: auto; margin-right: auto;"/>
</div>  

Java code creating JavaScript code in string buffer:

if(flag == false){
    flag = true;
    buffer.append("$('#toHide').doTimeout(1000, ");
    buffer.append("function() { ");
    buffer.append("$('#").append(component.getMarkupId()).append("').submit(");     
    buffer.append(");");
    buffer.append("$('#toHide').html('<img id=\"loadingImg\" src=\"../../img/load.gif\" style=\"margin-left: auto; margin-right: auto;\"/>'); ");
    buffer.append("});\n");
    }
    else{
       buffer.append("\n document.getElementById(\'#toHide\').style.display='none';\n");    
    }
    buffer.append("</script>");

2) i have declared flag=false at the global level. i am verifying for the first time for flag and allowing to enter if block shown above. But after this, image still display in next page. why? what changes i need to make?

  • 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-05-22T20:12:09+00:00Added an answer on May 22, 2026 at 8:12 pm

    For jQuery, try:

    buffer.append("\n $(\'#toHide\').hide();\n");
    

    instead of

    buffer.append("\n document.getElementById(\'#toHide\').style.display='none';\n");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this ajax jquery code: var form = document.getElementById('frm'); var data_string = form.serialize();
In most browsers, an input type=file has the following files property: document.getElementById(my-input).files This can
I'm not sure why I'm getting this error: connection is not defined document.getElementById(flashTest).sendValFromHtml(connection.value); This
I'm trying to parse and load an XML document, however I'm getting this exception
var radiobox = document.getElementById('<%=rdoRiskAccepted.ClientID%>'); alert(radiobox[0].checked); I am getting undefined as a alert. what am
I am using canvas,and I have this code - var myCanvas = document.getElementById(myCanvas), ctx
What's wrong with this code? var divarray = document.getElementById(yui-main).getElementsByTagName(div); var articleHTML = array(); var
Why doesn't this code work? I'am using FF. <head> <script type=text/javascript> document.getElementById(someID).onclick = function(){
I have a code like this <script type=text/javascript> function email(){ var myTextField = document.getElementById('email_hidden').value;
I'm not getting the same result when I use JQuery vs javascript functions. This

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.