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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:56:28+00:00 2026-06-13T23:56:28+00:00

I am using joomla 2.5 and I want to modified a <div> tag with

  • 0

I am using joomla 2.5 and I want to modified a <div> tag with ajax and mootools

In my index.php file I have this:

<div id="content" class="column grid_16">
    <div id="content" class="column grid_4">
        <jdoc:include type="modules" name="menuHardware" style="none"/>
        <jdoc:include type="modules" name="menuArq" style="none"/>
    </div>

    <div id="content" class="column grid_9">
        <jdoc:include type="modules" name="mod_arq" style="none"/>
    </div>
    <jdoc:include type="component" />

    <jdoc:include type="modules" name="mod_fabricante" style="none"/>
    <jdoc:include type="modules" name="mod_noticias" style="none"/>
</div>

This is my code in <jdoc:include type="modules" name="menuArq" style="none"/>:

<div id="content" class="column grid_4">
    <ul class="menu">
        <li class="item-129"><a href="index.php/descripcion">Descripción</a></li>
        <li class="item-130"><a href="index.php/descripcion">Descripción</a></li>
        <li class="item-131"><a href="index.php/descripcion">Descripción</a></li>
        <li class="item-132"><a href="index.php/descripcion">Descripción</a></li>
        <li class="item-133"><a href="index.php/descripcion">Descripción</a></li>
    </ul>
</div>

And my module <jdoc:include type="modules" name="mod_arq" style="none"/> have this:

<div id="myDivTobeChanged">some text for change</div>

So finally my page is:

<div id="content" class="column grid_16">
    <div id="content" class="column grid_4">
    <ul class="menu">
        <li class="item-129">
            <a href="/index.php/descripcion">Descripción</a>
        </li>
        <li class="item-130">
            <li class="item-131">
                <li class="item-132">
                    <li class="item-133">
    </ul>
</div>
<div id="content" class="column grid_9">
    <div id="myDivTobeChanged">some text for change</div>
</div>

when I click here <li class="item-129"><a href="/index.php/descripcion">Descripción</a></li> I want to change this

<div id="myDivTobeChanged">some text for change</div>

This is my script to call ajax:

$$('.item-129').addEvent('click', function(event){
    event.stop();
    var req= new Request({
        method: 'get',
        url: '<?php echo JURI::root()?>index.php',
        data: {'do': '1'},
        onComplete: function(responseText){
            $('myDivTobeChanged').set('html', responseText);
        }
    }).send();
});

But this don´t work only change to description page but not inside the <div> tag.

  • 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-13T23:56:29+00:00Added an answer on June 13, 2026 at 11:56 pm

    I see the div in your code has class ‘grid_4’, but the one you try to modify has ‘column grid_9’. If you want to change the contents of a particular div it would be much better to refer to it by id or you will have to fetch an array of elements having particular class via $$('.grid-9').

    Another problem is that you mix pure JavaScript with MooTools, that is generally a bad idea. If a MooTools library provide a function to solve your problem, it is better to use it rather than standard JavaScript. For example to change HTML contents of an element, use set('html', someHTML) rather than innerHTML method.

    So, try giving your div to be changed an id and changing you line

    document.getElementsByClassName('column grid_9').innerHTML= responseText;
    

    to something like this:

    document.id('#myDivTobeChanged').set('html', responseText);
    

    This is a complete solution for illustration purposes that works. You can use it for reference:

    //javascript
    <script type="text/javascript">
    window.addEvent('domready', function(){
            $$('.item-129').addEvent('click', function(event){
                 event.stop();
                  var req = new Request({
                  method: 'get',
                  url: 'http://someurl.com/test.php',
                  data: { 'do' : '1' },
    
                  onComplete: function(responseText) { 
                  $('myDivTobeChanged').set('html', responseText);
                  }
                }).send();
            });
    
    
        });
    </script>
    
    //sample html
    <div id="content" class="column grid_4">
    <ul class="menu">
    <li class="item-129"><a href="index.php/descripcion">Descripción</a></li>
    <li class="item-130"><a href="index.php/descripcion">Descripción</a></li>
    <li class="item-131"><a href="index.php/descripcion">Descripción</a></li>
    <li class="item-132"><a href="index.php/descripcion">Descripción</a></li>
    <li class="item-133"><a href="index.php/descripcion">Descripción</a></li>
    </ul>
    </div>
    
    <div id="myDivTobeChanged">som text for change</div>
    

    Just make change the address the Request is send to and customize the id of the target HTML div to be changed

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

Sidebar

Related Questions

I'm using joomla 1.7 and I want for some users to not have the
I am using Joomla 1.5.22 with Mootools 1.1. I have a module with a
i'm using Joomla 1.6 + mysql What I want to do at this point
I want to create custom form validation in joomla using ajax or jQuery. on-blur
I m using mootools 1.1 for developing joomla component. i want to get the
I'm using Mootools in a joomla site. I want to do a basic banner
I have created web-site using Joomla 2.5. In this website, I have used registration.
I am using Joomla 2.5. I want to use Joomla DB instance in my
I am using Joomla 1.6 along with JCE 2.0.15 I also have created my
I have created web-application using Joomla 2.5. In that I have used Joomla user

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.