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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T09:30:12+00:00 2026-06-09T09:30:12+00:00

On my index.php page I use the jquery load() to load other pages in

  • 0

On my index.php page I use the jquery load() to load other pages in a div “bodycontent”. This works fine and dandy. I disable regular links, and must make the href the page name, without the php, and tag the php back on when the load() occurs. One of my pages I’m loading in the div I have dialog boxes pop up on links.

When you initially go to the page, this works fine, but if you steer away by clicking on “products” or any other link on the page at all, and then go back to “home” and click on a link “read more”, the dialog boxes will not show up again. You have to refresh, and then it will work until you click a link again. Also, this works fine in my IE 9, ver9.0.8, but older IE at work (like 8), and at least one other persons chrome the dialog box will not come up at all. There are also IE9’s at my work that this will just not work on, despite me deleting temp internet files, ect. On my computer it works fine on brand new downloads of firefox, chrome and IE, so I’m also wondering if my method is backwards compatible and cross browser, and if not what I can do to make it so. I’m also using get script in a function with the load to pull the jquery, jquery ui, and my javascript file for the dialog.

I’ve also looked at things like ajaxcomplete and such, but being mine initially works, I’m not really sure what to do.

My site main index page loading home.php initially (the news, ect)

Fiddle with my navigation javascript, which makes the pages inactive/active and load()/getscript in the div

dialog.js:

$(document).ready(function() {
$('#dialogbox').dialog({
    autoOpen: false,
    title: 'Loading title...', 
    modal: true,
    width: 500,
    height: 400
});
});
function readMore(id,title,cat,desc,post,auth) { 
//alert(id +","+ title +","+ cat +","+ desc +","+ post +","+ auth); 
var $dialog = $('#dialogbox').html('Category: '+ cat +'<br/>'+ desc +'<br/>---------------------------------<br/>Posted by: '+ auth +'<br/>' + post);
$dialog.dialog('open');
$dialog.dialog("option","title",title);
} 

How I pull to function readMore:

            <?php
                require('config/dbconfig.php');
                $query = "SELECT * FROM news ORDER BY id DESC LIMIT 4";
                if ($stmt = $mysqli->prepare($query)) {
                    /* execute statement */
                    $stmt->execute();

                    /* bind result variables */
                    $stmt->bind_result($idn, $titlen, $categoryn, $descn, $postdaten, $authorn);

                    /* fetch values */
                    while ($stmt->fetch()) {
                        //echo 'id: '. $id .' title: '. $title;
                        echo "<table border='0'>";
                        $shortDescLengthn = strlen($descn);
                        if ($shortDescLengthn > 106) {
                            $sDCutn = 106 - $shortDescLengthn;
                            $shortDescn = substr($descn, 0, $sDCutn);
                        } else {
                            $shortDescn = $descn;
                        }
                        echo "<h1>$titlen</h1>"; 
                        echo "<tr><td>$shortDescn...</td></tr>"; 
                        echo '<tr><td><a href="javascript:void(0);" onclick="' 
                        . 'readMore(' . $idn . ',' . htmlspecialchars(json_encode($titlen)) . ',' 
                        . htmlspecialchars(json_encode($categoryn)) . ',' 
                        . htmlspecialchars(json_encode($descn)) . ',' . htmlspecialchars(json_encode($postdaten)) . ',' 
                        . htmlspecialchars(json_encode($authorn)) . ')">Read More</a></td></tr>'; 
                        echo "<tr><td>Written by: $authorn</td></tr>"; 
                        echo '<tr><td><img src="images/hardcore-games-newsbar-border.png" width="468px" /></td></tr>'; 
                    }
                    echo "</table><br />";

                    /* close statement */
                    $stmt->close();
                }

                /* close connection */
                $mysqli->close();
            ?>

So again, basically I need to see why this isn’t working after I click a link, and how it can be more cross browser and backwards browser compatible.

  • 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-09T09:30:14+00:00Added an answer on June 9, 2026 at 9:30 am

    All I had to do was add:

    $('#bodycontent').empty();
    

    before the load(), and it works on every computer I’ve tried so far. I’m guessing the div needed to be emptied before loading new html in it, so going back it was keeping the js and such from getscript and messing up. Also only kept the single js file that was required only by home.php to be loaded, and put everything else in the index page (like it should have been anyways).

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

Sidebar

Related Questions

index.php has this jquery code which loads notifications.inc.php into a div on the page
The page having problems is... http://schnell.dreamhosters.com/index.php?page=gallery# I use Firebug to debug my jQuery and
In my web-application i have a div which loads another page: $('#main').load('pages/main.php'); main.php consists
I have index.php and use jQuery .load() to load content from load.php. When I
I have a function that I use on index.php page and I would like
I have a index.php page that is the main page. All pages are included
I have the following scenario. I have a index.php page with the following JQuery
I'm looking for a way to use jQuery with a script index.php that is
I'm rebuilding a website to use Jquery Address to load in a page's content
Right now I use a pagination system that requires url like http://mypage.com/index.php?page=1 http://mypage.com/index.php?page=2 http://mypage.com/index.php?page=3

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.