Page 1 of 1

Javascript equivalent for file_get_contents

Posted: Sun Aug 14, 2005 12:54 pm
by anjanesh
Hi

Whats the Javascript equivalent for PHP's file_get_contents ?

Code: Select all

My Content
<script type="text/javascript">
document.open("http://anotherpage.php"); // I know this is not the way because this opens a new page
</script>
Any way without using frames ?

Thanks

Posted: Sun Aug 14, 2005 7:03 pm
by feyd
there isn't one, within a single function..

You may be able to use XMLHTTP, but why?

Posted: Sun Aug 14, 2005 11:26 pm
by anjanesh
Say I need to insert a page from another server but above that page will be my Javascript function.

Posted: Sun Aug 14, 2005 11:50 pm
by feyd
that doesn't explain why you couldn't just store that as a single script on it's own..