Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Old 08-02-2009, 06:00 PM fopen
Experienced Talker

Posts: 41
Trades: 0
i seem to be having some trouble using fopen with javascript, it says object expected

fh = fopen('mapdata.txt', "r");
if(fh!=-1)
{
str = fread(fh, 10000);
fclose(fh);
myZ.innerHTML = str;
}
flatrat is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 08-02-2009, 08:06 PM Re: fopen
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
And does "mapdata.txt" exist on the client machine??
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 08-02-2009, 08:07 PM Re: fopen
Experienced Talker

Posts: 41
Trades: 0
yes and its in the same folder as the webpage
flatrat is offline
Reply With Quote
View Public Profile
 
Old 08-02-2009, 08:10 PM Re: fopen
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
How do you know where the webpage is ON THE CLIENT MACHINE??
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 08-02-2009, 08:21 PM Re: fopen
Experienced Talker

Posts: 41
Trades: 0
my computer is acting as a server and im testing it from here,
but isnt fopen used to read something on the server to begin with?
flatrat is offline
Reply With Quote
View Public Profile
 
Old 08-03-2009, 11:59 AM Re: fopen
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,985
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
I'm confused. fopen() as I know it is a PHP function, and it doesn't exist in my Firefox browser. You do know that JavaScript isn't meant to read and write to files, right? Even if this is some sort of extension that it allows it to work on your computer, you won't ever be able to use it for a public site.

Where are you getting information about this?
__________________
Join me on
Please login or register to view this content. Registration is FREE
wayfarer07 is offline
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 08-04-2009, 06:43 PM Re: fopen
Experienced Talker

Posts: 41
Trades: 0
google, and i abbadon the idea, im just going to link it to a php page read/write it there redirect it back to my page read it with php then convert the string to javascript
flatrat is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to fopen
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.77591 seconds with 12 queries