Go Back   CodingForums.com > :: Client side development > JavaScript programming > Ajax and Design

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 02-12-2008, 12:32 PM   PM User | #1
gilgalbiblewhee
Regular Coder

 
Join Date: Mar 2005
Posts: 735
Thanks: 4
Thanked 1 Time in 1 Post
gilgalbiblewhee is an unknown quantity at this point
Ajax to extract a div from another page possible?

Would it be possible to use Ajax and take a portion such as in a div from another page?
gilgalbiblewhee is offline   Reply With Quote
Old 02-12-2008, 12:35 PM   PM User | #2
Inigoesdr
Super Moderator


 
Inigoesdr's Avatar
 
Join Date: Mar 2007
Location: Florida, USA
Posts: 3,601
Thanks: 2
Thanked 397 Times in 390 Posts
Inigoesdr is a jewel in the roughInigoesdr is a jewel in the roughInigoesdr is a jewel in the rough
Sure, as long as the other page is on the same domain.
Inigoesdr is offline   Reply With Quote
Old 02-12-2008, 03:44 PM   PM User | #3
Kor
Red Devil Mod


 
Kor's Avatar
 
Join Date: Apr 2003
Location: Bucharest, ROMANIA
Posts: 8,478
Thanks: 58
Thanked 379 Times in 375 Posts
Kor has a spectacular aura aboutKor has a spectacular aura about
It is possible to grab HTML information from other domains as well, but in this case you need a server-side application (written in php, asp...) which receives the AJAX request, sends it to another server, gets the response and sends it back to the AJAX object.
__________________
KOR
Offshore programming
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Kor is offline   Reply With Quote
Old 02-12-2008, 09:21 PM   PM User | #4
gilgalbiblewhee
Regular Coder

 
Join Date: Mar 2005
Posts: 735
Thanks: 4
Thanked 1 Time in 1 Post
gilgalbiblewhee is an unknown quantity at this point
Is there any tutorial related to this ( Ajax and php )? I asked this question in the php section but I think my post got deleted without me getting any further.
gilgalbiblewhee is offline   Reply With Quote
Old 02-12-2008, 09:50 PM   PM User | #5
Kor
Red Devil Mod


 
Kor's Avatar
 
Join Date: Apr 2003
Location: Bucharest, ROMANIA
Posts: 8,478
Thanks: 58
Thanked 379 Times in 375 Posts
Kor has a spectacular aura aboutKor has a spectacular aura about
I found myself a ready-made php application for that on doing a simply google (I wanted not to reinvent the wheel)... I can not give you the link towards right now, as I am home, not at the office, but gimme a PM to remind me, and I might point you to that. Fell free to google yourself for, but you must know the basis of php to work with...
__________________
KOR
Offshore programming
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Kor is offline   Reply With Quote
Old 02-12-2008, 09:50 PM   PM User | #6
liorean
The thread killer


 
Join Date: Feb 2003
Location: Umeå, Sweden
Posts: 5,575
Thanks: 0
Thanked 84 Times in 75 Posts
liorean will become famous soon enoughliorean will become famous soon enough
Quote:
Originally Posted by gilgalbiblewhee View Post
I asked this question in the php section but I think my post got deleted without me getting any further.
Actually you posted it here in the same forum, and it got deleted as an obvious dupe, seeing two threads right next to each other with the same subject and similar contents tends to make me do that.
__________________
liorean <[lio@wg]>
Articles: RegEx evolt wsabstract , Named Arguments
Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards
liorean is offline   Reply With Quote
Old 02-12-2008, 11:16 PM   PM User | #7
gilgalbiblewhee
Regular Coder

 
Join Date: Mar 2005
Posts: 735
Thanks: 4
Thanked 1 Time in 1 Post
gilgalbiblewhee is an unknown quantity at this point
Quote:
Originally Posted by liorean View Post
Actually you posted it here in the same forum, and it got deleted as an obvious dupe, seeing two threads right next to each other with the same subject and similar contents tends to make me do that.
It wasn't intentional. I posted in the php section. I read the answer in my email. But when I clicked the link it wasn't there. But fortunately I had a tab already open. So I copied from that content and pasted it the the AJAX section.
gilgalbiblewhee is offline   Reply With Quote
Old 02-13-2008, 08:31 AM   PM User | #8
Kor
Red Devil Mod


 
Kor's Avatar
 
Join Date: Apr 2003
Location: Bucharest, ROMANIA
Posts: 8,478
Thanks: 58
Thanked 379 Times in 375 Posts
Kor has a spectacular aura aboutKor has a spectacular aura about
Here's a link for the article and php applications:
http://www.troywolf.com/articles/php/class_http/

I tested and used that successfully, together with AJAX in one of my sites.
__________________
KOR
Offshore programming
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Kor is offline   Reply With Quote
Old 03-24-2008, 10:23 PM   PM User | #9
gilgalbiblewhee
Regular Coder

 
Join Date: Mar 2005
Posts: 735
Thanks: 4
Thanked 1 Time in 1 Post
gilgalbiblewhee is an unknown quantity at this point
Quote:
Originally Posted by Kor View Post
Here's a link for the article and php applications:
http://www.troywolf.com/articles/php/class_http/

I tested and used that successfully, together with AJAX in one of my sites.
I finally got a chance to look at the script and I tested it. I have two pages:
class_http.php
example.php

I pasted every other bits of codes mentioned in your link in the example page.

But if I'm going to simply pick up, let's say the div tags from another page how would that be possible? Which scripts apply to that?
Attached Files
File Type: zip classhttp.zip (8.5 KB, 151 views)

Last edited by gilgalbiblewhee; 03-25-2008 at 01:57 AM..
gilgalbiblewhee is offline   Reply With Quote
Old 03-25-2008, 02:08 AM   PM User | #10
A1ien51
Senior Coder

 
A1ien51's Avatar
 
Join Date: Jun 2002
Location: Between DC and Baltimore In a Cave
Posts: 2,717
Thanks: 1
Thanked 94 Times in 88 Posts
A1ien51 will become famous soon enough
Screen scraping is not very nice thing to do....You should get permission before taking someone else's content and causing extra load on their servers....

Eric
__________________
Tech Author [Ajax In Action, JavaScript: Visual Blueprint]
A1ien51 is offline   Reply With Quote
Old 03-25-2008, 03:39 AM   PM User | #11
gilgalbiblewhee
Regular Coder

 
Join Date: Mar 2005
Posts: 735
Thanks: 4
Thanked 1 Time in 1 Post
gilgalbiblewhee is an unknown quantity at this point
I want to use it from my own pages. I give myself the permission.
gilgalbiblewhee is offline   Reply With Quote
Old 03-25-2008, 05:52 AM   PM User | #12
A1ien51
Senior Coder

 
A1ien51's Avatar
 
Join Date: Jun 2002
Location: Between DC and Baltimore In a Cave
Posts: 2,717
Thanks: 1
Thanked 94 Times in 88 Posts
A1ien51 will become famous soon enough
Quote:
Originally Posted by gilgalbiblewhee View Post
I want to use it from my own pages. I give myself the permission.
If it is from your own pages, than why don;t you build yourself a JSON servoce or a web service to get the info. There is no need to scrape a page when you own the code.

Eric
__________________
Tech Author [Ajax In Action, JavaScript: Visual Blueprint]
A1ien51 is offline   Reply With Quote
Old 03-25-2008, 06:32 AM   PM User | #13
gilgalbiblewhee
Regular Coder

 
Join Date: Mar 2005
Posts: 735
Thanks: 4
Thanked 1 Time in 1 Post
gilgalbiblewhee is an unknown quantity at this point
Quote:
Originally Posted by A1ien51 View Post
If it is from your own pages, than why don;t you build yourself a JSON servoce or a web service to get the info. There is no need to scrape a page when you own the code.

Eric
JSON? Is that what it's called? Ok I'll look into it. Thanks.
gilgalbiblewhee is offline   Reply With Quote
Old 03-25-2008, 06:17 PM   PM User | #14
gilgalbiblewhee
Regular Coder

 
Join Date: Mar 2005
Posts: 735
Thanks: 4
Thanked 1 Time in 1 Post
gilgalbiblewhee is an unknown quantity at this point
Ok I looked into JSON. From what I've seen JSON isn't what I'm looking for. My intention of grabbing information from one source to the next is from my own domain is to populate them in a database. I have a 700 paged ebook converted to html. So I want to grab all the div tags automatically instead of me doing things manually. DO you understand what I'm saying?
gilgalbiblewhee is offline   Reply With Quote
Old 03-25-2008, 09:48 PM   PM User | #15
Kor
Red Devil Mod


 
Kor's Avatar
 
Join Date: Apr 2003
Location: Bucharest, ROMANIA
Posts: 8,478
Thanks: 58
Thanked 379 Times in 375 Posts
Kor has a spectacular aura aboutKor has a spectacular aura about
We do understand. It is possible, but... do you have "700 paged ebook" and no DataBase?
__________________
KOR
Offshore programming
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Kor is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:24 AM.


Advertisement
Log in to turn off these ads.