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 8608213
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T03:32:58+00:00 2026-06-12T03:32:58+00:00

Possible Duplicate: JavaScript – what are alternatives to document.write? i am creating a javascript

  • 0

Possible Duplicate:
JavaScript – what are alternatives to document.write?

i am creating a javascript function which i want to execute after few seconds but when it executes it removes all the page content and display only that result which i am displaying using document.write() here is my javascript code.

<script language="javascript">
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
 xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}

setTimeout(function(){
xmlhttp.open("GET","some.xml",false);
xmlhttp.send();
xmlDoc=xmlhttp.responseXML;
var x=xmlDoc.getElementsByTagName("offer");
var page = parseInt(x.length) / 10;
document.write("<div class='pagination_btn_cont'>");
for (i=1;i<=page;i++)
{ 
 document.write("<div class='pagination_btn'>"+i+"</div>");
}
document.write("</div>");
},10000);

</script>

when i open the webpage its display all the content of the page but after 10 seconds the page will become blank and display only the numbers which i am getting from the loop.

any suggestion how can do this task.

  • 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-12T03:33:00+00:00Added an answer on June 12, 2026 at 3:33 am

    You can use innerHTML in javascript.
    It use to insert data to particular div without affecting page contents.

    Example:

    var results = "";
    for(var i=1;i<=10;i++)
    {
         results += "<div class='pagination_btn'>"+i+"</div>";
    }
    document.getElementById("your result show div id").innerHTML = results;
    

    you can specify $('.pagination_btn').bind("click")... inside your document.ready

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Javascript window resize event I want to get an event which is
Possible Duplicate: javascript domready? I want to check whether $(function(){ }); is ready. Return
Possible Duplicate: JavaScript: var functionName = function() {} vs function functionName() {} AFAIK, there
Possible Duplicate: JavaScript === vs == : Does it matter which “equal” operator I
Possible Duplicate: JavaScript: Why the anonymous function wrapper? I would like to ask you
Possible Duplicate: JavaScript Function Definition in ASP User Control Hi, I have a generic
Possible Duplicate: Javascript Closure Problem In the following code, TrueThis.aChoices[i]['CallBack'] is a function when
Possible Duplicate: Javascript function to add X months to a date I'd like to
Possible Duplicate: JavaScript: var functionName = function() {} vs function functionName() {} What is
Possible Duplicate: javascript syntax: function calls and using parenthesis t.onclick = doSomething t.onclick =

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.