Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
replace content of <div> tag
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
sri  
View profile  
 More options Feb 10, 11:56 pm
From: sri <srik1...@gmail.com>
Date: Tue, 10 Feb 2009 20:56:46 -0800 (PST)
Local: Tues, Feb 10 2009 11:56 pm
Subject: replace content of <div> tag
Could any one help to me. I am new to the Ajax. I stucked with one
problem replacing the content of <div> tag.
I can get the links in test.html by click on button. When I click on
the url it is displaying the content in another page, but I am looking
for the content should also have to display in <div> region.
Here as follows my code :

This is the main file

example1.html
------------------------
<html>
        <head>
                <title>Test Example</title>
                <script type="text/javascript" src="ajax1.js"> </script>

        </head>
        <body>

                <div id="mainContainer">
                <div id="header">
                        <img src="/images/heading3.gif">
                </div>
                <div id="contentContainer">
                        <h2 class="openingText">Click on one of the articles to the right.</
h2>
                        <p>This will load the the content of external articles into this
DIV</p>
                </div>
                <div id="articleListContainer">
                        <ul id="articleList" class="articleList">
                                <li id="article1"><input type="button" value="Click" onClick="load
('test.html', 'contentContainer');"/></li>
                                <li id="article2">This is the second article</li>
                                <li id="article3">Article number 3</li>
                                <li id="article4">About AJAX</li>
                                <li id="article5">Article number 5</li>
                                <li id="article6">Article number 6</li>
                                <li id="article7">Article number 7</li>
                                <li id="article8">Article number 8</li>
                                <li id="article9">Article number 9</li>
                        </ul>
                </div>
        </body>
</html>

test.html
---------------
<html>
<head>
                <script type="text/javascript" src="ajax1.s"></script>
</head>
<body>
<a href="javascript::load('article1.html','contentContainer')"

>Article1</a> <br/>

<a href="article2.html" onClick="load
('article2.html','contentContainer')" >Article2</a> <br/>
<a href="article3.html" onClick="load
('article3.html','contentContainer')" >Article3</a> <br/>
<a href="article4.html" onClick="load
('article4.html','contentContainer')" >Article4</a> <br/>
<a href="article5.html" onClick="load
('article5.html','contentContainer')" >Article5</a> <br/>
<a href="article6.html" onClick="load
('article6.html','contentContainer')" >Article6</a> <br/>
<a href="article7.html" onClick="load
('article7.html','contentContainer')" >Article7</a> <br/>
<a href="article8.html" onClick="load
('article8.html','contentContainer')" >Article8</a> <br/>

<a href="test.html" onClick="load('test.html','contentContainer')"

>Back</a>

</body>
</html>

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Phill-X  
View profile  
 More options Feb 11, 6:39 am
From: Phill-X <gllphill...@gmail.com>
Date: Wed, 11 Feb 2009 03:39:45 -0800 (PST)
Local: Wed, Feb 11 2009 6:39 am
Subject: Re: replace content of <div> tag
Hi Sri,
You can actually do this simply using an Iframe instead of a Div.

Use an Iframe like this
<iframe id='url_frame'></iframe>

and the call a function like this to add a new page to iframe

function changeIframe()
{
document.getElementById(url_frame).src = url;
return false;

}

On Feb 11, 9:56 am, sri <srik1...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
srikanth m  
View profile  
 More options Feb 11, 8:28 am
From: srikanth m <srik1...@gmail.com>
Date: Wed, 11 Feb 2009 18:58:59 +0530
Local: Wed, Feb 11 2009 8:28 am
Subject: Re: replace content of <div> tag

Thank you Phill,

I could solve it.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google