By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,712 Members | 2,174 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,712 IT Pros & Developers. It's quick & easy.

Object expected error...

P: n/a
bjc
Why is this code:

<a
href="javascript:readFile('file:http://localhost/mySite/myFile.txt')">
View File</a>

Throwing an error??? Thanks in advance!

Oct 6 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
bjc wrote:
Why is this code:

<a
href="javascript:readFile('file:http://localhost/mySite/myFile.txt')">
View File</a>

Throwing an error??? Thanks in advance!


Possibly: you haven't included the code for readFile(), the parameter
you are passing is incorrect, security setting/model is preventing
access to the file.

Maybe all of the above.

What do you expect to happen? What is wrong with:

<a href="http://localhost/mySite/myFile.txt">View File</a>
--
Rob
Oct 6 '05 #2

P: n/a
bjc
Hi Rob - Thanks for the reply. I'll try your suggestion.

Oct 6 '05 #3

P: n/a
Lee
bjc said:

Why is this code:

<a
href="javascript:readFile('file:http://localhost/mySite/myFile.txt')">
View File</a>

Throwing an error??? Thanks in advance!


Without being able to see the code for readFile(), my best guess is
that it expects a valid URL, and valid URL's do not begin with "file:http:".
Using the side-effect of the "javascript:" pseudo-protocol is usually
a mistake, as well.

Oct 6 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.