Javascript equivalent for file_get_contents

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

Javascript equivalent for file_get_contents

Post 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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

there isn't one, within a single function..

You may be able to use XMLHTTP, but why?
User avatar
anjanesh
DevNet Resident
Posts: 1679
Joined: Sat Dec 06, 2003 9:52 pm
Location: Mumbai, India

Post by anjanesh »

Say I need to insert a page from another server but above that page will be my Javascript function.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

that doesn't explain why you couldn't just store that as a single script on it's own..
Post Reply