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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T14:56:25+00:00 2026-05-13T14:56:25+00:00

My website contains links and when I click on a click, the target HTML

  • 0

My website contains links and when I click on a click, the target HTML content is loaded into a “div” using JQuery, no problem so far.

My problem is when my search page below is loaded for the third time, the script will not execute:

<h1><span>Search</span></h1>
<p class="bigtext">Entity</p>
<input type="text" id="searchfield">
<p class="more">
    <a href="#">Find</a>
</p>
<p></p>
<div id="res"></div>

<script type="text/javascript">
    alert("hello");
</script>

Observe that the script works for the two first times, but not for the third time. I have also tried changing the position etc, but no postive results. The problem only occurs for the search page, the HTML content is loaded, I also see the script using Firebug, but it won’t execute the alert().

My general load-into-div script is this:

<script type="text/javascript">
$(document).ready(function()
{
    var page = "blog";

    $('a').click(function()
    {
        var id = $(this).attr("id");
        if ( id != null && id !="" )
        {
            page = "index.php/"+id;
            $("#inc").load(page);
        }
    });

    setInterval(function() {
        if (page=="index.php/toplist")
            $("#inc").load(page);
    }, 6000);
});
</script>

Any suggestions on how to solve this problem? Thanks in advance.

// Hirre

  • 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-13T14:56:25+00:00Added an answer on May 13, 2026 at 2:56 pm

    Loading HTML with <script> elements into the page is basically unreliable. jQuery takes a number of steps to try to make it work cross-browser, but in several cases jQuery fails.

    So don’t rely on it. Keep your script content in the basic script instead, run from callback after loading if necessary.

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

Sidebar

Related Questions

I have a website that uses ajax jquery and colorbox. Inside the div #content
On my HTML5 website, my aside content often contains navigation links to engage the
I am using a website which contains a gridview for view details of Product
I am designing a small website using HTML + JSP. This is my first
If you visit this website http://inelmo.com/inelmo and click on one of the comments links
I have a website that contains links to other sites only. They link to
I have a website that uses the facebook, twitter, delicious share links. They contain
I got a website which contains a lot of projects with each project containing
Is there any one website which contains many good C# screencasts?
I have a page on a website that contains a secure form inside an

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.