Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Jan 13th, 2008, 11:29 AM   #1
keioGirl
Newbie
 
Join Date: Jan 2008
Posts: 5
Rep Power: 0 keioGirl is on a distinguished road
Smile javascript web page reader and writer

The last problem is ok now!!

I would like to save/get some web pages which i'm browsing like 'save as' function and make some modification to that webpage and then rewrite to the browser again using javascript. Is it possible? If then, which function I have to use to retrieve that page and then to rewrite.
Please tell me!!
keioGirl is offline   Reply With Quote
Old Jan 13th, 2008, 12:38 PM   #2
kruptof
Professional Programmer
 
kruptof's Avatar
 
Join Date: May 2006
Location: UK - London
Posts: 317
Rep Power: 3 kruptof is on a distinguished road
Re: javascript web page reader and writer

Get the source of the target on the server using file_get_contents(assuming your using php on the server side) or something similar. Then you could probably parse this and ask the user the parts they want to change.
__________________
Quote:
When I was young it seemed that life was so wonderful,a miracle, oh it was beautiful, magical.
Now watch what you say or they'll be calling you a radical,a liberal, oh fanatical, criminal. Oh won't you sign up your name,we'd like to feel you're acceptable, respectable, oh presentable, a vegetable
kruptof is offline   Reply With Quote
Old Jan 13th, 2008, 3:24 PM   #3
null_ptr0
11 years old
 
Join Date: Nov 2007
Posts: 79
Rep Power: 1 null_ptr0 is on a distinguished road
Re: javascript web page reader and writer

Kruptof, nice, BUT IT'S NOT PHP, MMKAY?
What he means is have it so the page is editable to the editor.
__________________
iload_0 iconst_1 ishl or
iload_0 iconst_2 idiv or
iload_0 iconst_2 iconst_1 imul idiv
[1] & [2] use the smallest stack size
null_ptr0 is offline   Reply With Quote
Old Jan 13th, 2008, 4:22 PM   #4
kruptof
Professional Programmer
 
kruptof's Avatar
 
Join Date: May 2006
Location: UK - London
Posts: 317
Rep Power: 3 kruptof is on a distinguished road
Re: javascript web page reader and writer

Well she didn't state which sever side language she was using and I did me make an ASS of yoU and ME. I as far as my knowledge goes(not far) I don't think you can do this alone on the client side without any help on the server side.
__________________
Quote:
When I was young it seemed that life was so wonderful,a miracle, oh it was beautiful, magical.
Now watch what you say or they'll be calling you a radical,a liberal, oh fanatical, criminal. Oh won't you sign up your name,we'd like to feel you're acceptable, respectable, oh presentable, a vegetable
kruptof is offline   Reply With Quote
Old Jan 13th, 2008, 10:16 PM   #5
keioGirl
Newbie
 
Join Date: Jan 2008
Posts: 5
Rep Power: 0 keioGirl is on a distinguished road
Re: javascript web page reader and writer

I mean...I just want to write something like firefox extension for my project. And I need to retrive the web page and then make some modification (matching with the keywords, it's part of my project) and then open a new page and put my modified web page onto it. It's no need to change the server side. I just only want to get the function which will be work as 'save as' function and then rewrite to a browser(firefox) again. I'll have to use JavaScript and Java.
keioGirl is offline   Reply With Quote
Old Jan 13th, 2008, 10:23 PM   #6
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Posts: 1,730
Rep Power: 5 Sane is on a distinguished road
Re: javascript web page reader and writer

You can do this using an asynchronous request with Javascript to the server, if the Javascript is provided by the same server that you want to make the request to. This process is known as "AJAX".

And I believe kruptof is correct in saying that there's no way to do it without help by the server (in this case, the "help" qualifies as a separate page that provides the Javascript).

If you did it with Java, it's a completely different story.
Sane is offline   Reply With Quote
Old Jan 14th, 2008, 4:48 AM   #7
keioGirl
Newbie
 
Join Date: Jan 2008
Posts: 5
Rep Power: 0 keioGirl is on a distinguished road
Re: javascript web page reader and writer

yeah...
I now know that I can do it without opening new page, just getting that page from the proxy server before it is shown in the web broswer and then make modification and then send it to the web browser.. just like some web filters.... but the question is how can i get that page from the proxy????
keioGirl is offline   Reply With Quote
Old Jan 14th, 2008, 5:34 AM   #8
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,435
Rep Power: 8 Ooble is on a distinguished road
Re: javascript web page reader and writer

You may be interested to know that the Web Developer toolbar extension for Firefox provides this functionality. Perhaps you could look at its source code - I believe Firefox extensions are written partly in JavaScript. It'll be complicated though - it's a huge project.
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 3:53 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC