Current location: Hot Scripts Forums » Programming Languages » PHP » Reading contents from file... Javascript? :(


Reading contents from file... Javascript? :(

Reply
  #1 (permalink)  
Old 08-09-08, 12:17 AM
Ninja's Avatar
Ninja Ninja is offline
Newbie Coder
 
Join Date: Aug 2008
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Reading contents from file... Javascript? :(

Hi..

Is it possible to read contents from a URL that were written by a javascript?

I usually read file contents with the get_file_contents function, but the code i get is the same as the one you get in a browser when you select view source - anything javascript (ajax) wrote on it does not exist. It makes sence of course, javascript could have written the extra data an hour after requesting the page, but in this case it's a script that is put on the scene and executed immediately, so I'm wondering if there is a way i could "wait for it" to finish the job and then read everything together?

I don't even want to get into the possible reasons why people would even use that on a page that doesn't even have ANY dynamic content!!

I just need the data....
Reply With Quote
  #2 (permalink)  
Old 08-09-08, 11:11 AM
Keith's Avatar
Keith Keith is offline
Community Liaison
 
Join Date: Feb 2004
Posts: 1,232
Thanks: 1
Thanked 11 Times in 11 Posts
By the way, it's file_get_contents().

Maybe that is why they are writing it like that, to avoid having their info leached so easily.
__________________
The toxic ZCE
Reply With Quote
  #3 (permalink)  
Old 08-09-08, 11:24 AM
Ninja's Avatar
Ninja Ninja is offline
Newbie Coder
 
Join Date: Aug 2008
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by Keith View Post
By the way, it's file_get_contents().
Right.. My bad.. That was after a really stressful day at work so...


Quote:
Originally Posted by Keith View Post
Maybe that is why they are writing it like that, to avoid having their info leached so easily.
I suppose this means that the answer is definitely no?
Reply With Quote
  #4 (permalink)  
Old 08-09-08, 01:25 PM
leeprice2006 leeprice2006 is offline
Newbie Coder
 
Join Date: Sep 2006
Posts: 68
Thanks: 0
Thanked 0 Times in 0 Posts
im guessing the only obvious way to do this is with regular expressions. basically look for text between document.write(" and "); see what you get
Reply With Quote
  #5 (permalink)  
Old 08-09-08, 05:21 PM
Ninja's Avatar
Ninja Ninja is offline
Newbie Coder
 
Join Date: Aug 2008
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by leeprice2006 View Post
im guessing the only obvious way to do this is with regular expressions. basically look for text between document.write(" and "); see what you get
No way, there is nothing that "easy" in the source code.. Maybe i wasn't precise enough... See, not the whole website is written by javascript. The website is written in php and calls a javascript function on load that fills certain tables and containers with data. It would be awesome if i could somehow wait for the code to execute or send a request for it or something or something.. I didnt really even try to look for what it writes out (not yet, at least) because the scripts are huuuuge and was really hoping to get this "easier" (if even possible) solution... Everything is f****ng javascript based! (i guess there's ajax in there 2, but who cares..)


And I'm thinking more and more that Keith is right (about their intention) and that this problem has no solution I can benefit from.

Last edited by Ninja; 08-09-08 at 05:24 PM.
Reply With Quote
  #6 (permalink)  
Old 08-13-08, 02:46 AM
<?Wille?> <?Wille?> is offline
Junior Code Guru
 
Join Date: Jan 2004
Location: Helsinki, Finland
Posts: 666
Thanks: 0
Thanked 0 Times in 0 Posts
get the Web Developer addon for firefox. it has a "View Generated Source". or you could write javascript in the address bar opening a page and writing the html tags innerHTML to that popup. or something
Reply With Quote
Reply

Bookmarks


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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Reading file path from file imatrox05 Visual Basic 1 12-20-06 10:01 AM
running code against contents of a file? vbsaltydog Perl 7 09-27-06 04:11 PM
How to read contents of .doc file using file handling atulkul PHP 2 07-19-06 08:38 AM
compare the contents of 2 file in php rani PHP 5 04-14-04 11:47 PM
Displaying TEXT file contents to HTML tables Mendo PHP 2 02-18-04 11:19 AM


All times are GMT -5. The time now is 07:53 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.