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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T02:53:47+00:00 2026-06-07T02:53:47+00:00

I searched through internet and this site as well but haven’t found the answer.

  • 0

I searched through internet and this site as well but haven’t found the answer. I would like to run a javascript code, which will go through articles at my site and choose&print some of them. The script works well when I run it after this articles:

[articles about smartphones]

[script which displays (prints) some of the articles about smartphones]

Obviously, it works correctly because script have what to search through – articles have already appeared at site, so javascript can take some elements.

But I want to invert the order:

[display some of the articles about smartphones there]

[show articles about smartphones there]

I assume that I should run the script after the articles loaded and than change the position of element, which was printed by script. I can do that with position: absolute; but it doesn’t look too elegant for me and I hope that there is another way to solve my problem. I tried body onload and running function at another place, but I haven’t do the trick.

Thank you for any help and suggestions : )

  • 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-07T02:53:49+00:00Added an answer on June 7, 2026 at 2:53 am

    I suppose you are using document.write to generate the HTML code to redisplay some of the articles. You should not use document.write. Instead, put the script at very end of your document, to make sure all HTML elememts are already present in the DOM. Then create a new HTMLNode, eg a div, and put it where you want it or select one from the DOM and put your new HTML into that node (the simplest way is to set innerHTML). Eg:

    <body>
      <div id="some_articles">
      </div>
      <div id="all_articles">
        <!--- here is the code for all articles -->
      </div>
      <script>
        var div = document.getElementById('some_articles');
        div.innerHTML = '<!-- code for some of the articles -->';
      </script>
    </body>
    

    This is very basic Javascript knowledge however. You should really read a good tutorial or a book on Javascript and DOM programming.

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

Sidebar

Related Questions

I've searched through the internet, but haven't found any solution in c#. Does anybody
I have searched this on the internet, but have found no solution... Here is
I have searched through internet & found that there are no any direct method
I have searched through many times but have not seen this before. Probably really
I've searched through the web and what I've found out is this: To make
I've searched over this topic but found very few details which were helpful. With
i really need some help on this. I searched the internet but couldn't find
I searched though the internet but could not found what i was looking for,
After looking through the questions on this site and doing a few internet searches
I searched through whole internet but I still don't understand how I need to

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.