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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T05:03:05+00:00 2026-06-18T05:03:05+00:00

this is my js code function load(div_tag,thefile) { if(window.XMLHttpRequest) { xmlhttp = new XMLHttpRequest();

  • 0

this is my js code

function load(div_tag,thefile)
{

    if(window.XMLHttpRequest)
    {
        xmlhttp = new XMLHttpRequest();
    }
    else
    {
        xmlhttp = new ActiveXObject('Microsoft.XMLHTTP');
    }
    xmlhttp.onreadystatechange = function()
    {
        if(xmlhttp.readyState == 4 && xmlhttp.status == 200)
        {
            document.getElementById(div_tag).innerHTML = xmlhttp.responseText;
        }
    }
    xmlhttp.open('GET', thefile, true);
    xmlhttp.send();
}

and this my php code

echo '<div style="float:left; margin-left:2px; margin-top:17px; background:#666; text-align:center; width:auto;"><a href="#div" onclick="load(\'div\',\'include/comment_form.php\')" style="text-decoration:none;"><b style="color:white;">Add comment</b></a></div>';

echo '<div id="div" align="left" style="clear:both;"></div>';

the problem is it’s working in xampp but it is not working in my website. I am a starter please help me.

  • 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-18T05:03:09+00:00Added an answer on June 18, 2026 at 5:03 am

    Answer to fit the successful comment:

    The function load() should return a value true or false, since it is in the onclick handler of a <a tag. Since load() does not return anything, the result is browser dependent.

    Just return true in load() to activate the anchor redirect

    function load(div_tag,thefile)
    {
        ...
        xmlhttp.open('GET', thefile, true);
        xmlhttp.send();
    
        return true;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this form submit code: Event.observe(window, 'load', init, false); function init() { Event.observe('addressForm',
I have (basically) this code - <script type=text/javascript language=javascript> $(document).ready(function() { $(#loadDiv).load(mypage.html, function(){ alert($(#someText).text())
This code: $(#permalink a).click(function(id){ var id = this.getAttribute('href'); $(#newPostContent).load(id, function() { $(#removeTrigger).click(function() { $(#removeThis).hideToggle();
On document ready I run this code: jQuery(document).ready(function(){ jQuery('#button').click(function() { jQuery('#contact_form').load(/Users/mge/Downloads/jquery-ajax-1/readme.txt); return false; });
I'm using a code that looks like that: img.load(function(){ // do some stuff $(this).width();
I have got this code: function init(){ if (typeof window.jQuery !== 'function') { var
I have this code that fades an image $(#mix).click(function() { $(#mix).addClass(load); $(#brick-image).stop(true).fadeTo(slow, 0); $(#brick-image).load(function()
With this code function someFunction(classParam:Class):Boolean { // how to know if classParam implements some
I have this code: function Keyboard() { this.log = $('#log')[0]; this.pressedKeys = []; this.bindUpKeys
I have this code: function submitTwice(f){ f.action = 'http://mydomain.com/threevideopage.php'; f.target='name'; f.submit(); } I left

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.