473,387 Members | 1,549 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

ajax-externalhtml-div issues

Hi, im trying to do some experimental ajax/javascript/dhtml work
based on a dynamic drive tutorial.

http://www.dynamicdrive.com/dynamici...tent.htm#combo

my problem is that i cannot find ANY information ANYWHERE AT ALL
on how to select a <div> from the EXTERNAL html page beingloaded.

basically i dont want to load an entire page. i only want to load specified
<div>s into other div containers.

can anyone help me?

I have narrowed it down to the following pieces of code:

function loadpage(page_request, containerid, originid){
if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))
document.getElementById(containerid).innerHTML=pag e_request.responseText
}

the LAST line document.getElementById(containerid) works and publishes
the entire html page (external.htm) into containerid in the index.htm page

BUT whenever i try to add ANY code to:

innerHTML=page_request.responseText
such as
innerHTML=page_request.getElementById(originid).re sponseText
or
innerHTML=page_request.responseText.getElementById (originid)
or
innerHTML.getElementById(originid)=page_request.re sponseText

NOTHING WORKS!!!

i'd be super appreciateive of anyone who might be able to guide me as to how to format my syntax so this can be done.

I know my originid and containerid variables are passing b/c i alerted them and they DEFINITELY work. it just has to do with the fact that i cant find any documentation on the proper way to do this (internet and like 4 books today scoured!)

thanks in advance to anyone out there

mk
Reply With Quote
Jun 6 '07 #1
3 1598
acoder
16,027 Expert Mod 8TB
Hi, im trying to do some experimental ajax/javascript/dhtml work
based on a dynamic drive tutorial.

http://www.dynamicdrive.com/dynamici...tent.htm#combo

my problem is that i cannot find ANY information ANYWHERE AT ALL
on how to select a <div> from the EXTERNAL html page beingloaded.

basically i dont want to load an entire page. i only want to load specified
<div>s into other div containers.

can anyone help me?

I have narrowed it down to the following pieces of code:

function loadpage(page_request, containerid, originid){
if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))
document.getElementById(containerid).innerHTML=pag e_request.responseText
}

the LAST line document.getElementById(containerid) works and publishes
the entire html page (external.htm) into containerid in the index.htm page

BUT whenever i try to add ANY code to:

innerHTML=page_request.responseText
such as
innerHTML=page_request.getElementById(originid).re sponseText
or
innerHTML=page_request.responseText.getElementById (originid)
or
innerHTML.getElementById(originid)=page_request.re sponseText

NOTHING WORKS!!!

i'd be super appreciateive of anyone who might be able to guide me as to how to format my syntax so this can be done.

I know my originid and containerid variables are passing b/c i alerted them and they DEFINITELY work. it just has to do with the fact that i cant find any documentation on the proper way to do this (internet and like 4 books today scoured!)

thanks in advance to anyone out there

mk
Reply With Quote
That's the incorrect syntax. What you probably want to do is parse responseText for the information that you want and then set the innerHTML to the parsed data.

Show an example of data/div that you want from a page.
Jun 6 '07 #2
that's the problem. im such a newbie im not even sure how to start going about this.

can you possibly point me in the correct direction
as in how to start parsing that data properly in ajax/js?

im mostly a flash programmer and thisi s my first hardcore ajax/js dealyo.

thanks also for helping me at least know what i need to look into for a solution.

:) mk
Jun 8 '07 #3
acoder
16,027 Expert Mod 8TB
See this example.

If you get stuck, post your code.
Jun 9 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: Yarco | last post by:
I want to use "Ajax" to create my web for hobby. But i don't know whether "Ajax" is mature... And what about with php? Someone have experience on it? ....
0
by: melledge | last post by:
Ajax Developers' Day added to XTech 2006 agenda XTech 2006 - 17-19 May - Hotel Grand Krasnopolsky - Amsterdam, The Netherlands
10
by: Steve | last post by:
I need to build a very dynamic client and would be interested in knowing the pros and cons of using JSF and Ajax to accomplish this. Thanks. Steve
7
by: Thirsty Traveler | last post by:
Peter Bromberg has an interesting article eggheadcafe discussing AJAX libraries. He prefers ANTHEM.NET over AJAX.NET because it doesn't break the stateful page model. Our developers are currently...
0
by: melledge | last post by:
Ajax Developers' Day to Kick Off XTech 2006 Conference Industry experts offer insight into next generation of the Web ALEXANDRIA, VIRGINIA, USA - April 25, 2006 - In response to the rapidly...
10
by: =?Utf-8?B?WWFua2VlIEltcGVyaWFsaXN0IERvZw==?= | last post by:
controlsPlease could some of you here post some of your live examples of AJAX (esp drag panels, collapsable panels, and popup menu.) (It's one thing to talk about how great something is, but it's...
2
by: soni2926 | last post by:
hi, does anyone know of any good books on ajax and asp.net, one that teaches ajax itself before jumping in atlas? I wanted to get an understanding of ajax and how to use it, most books i've seen...
1
by: shaunwo | last post by:
I'm an AJAX / DOM Novice (at best) and trying to figure out how to write the value to a couple input fields. I don't remember exactly where I got the ajax.js file I'm using from (went to the website...
6
by: Scott M. | last post by:
What is the version number of AJAX when we talk about ASP .NET AJAX in VS 2008?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.