insideorkut.com

Can someone share with me any experience they have with iContact email marketing?bulk emailing to ad

Try iContact email marketing for free for 30 days. Click here to use coupon...

Get a free trial of iContact here. Click here for this special deal...
First question I got is Can someone share with me any experience they have with iContact email marketing?bulk emailing to ad Looking forward for any response. Another question on my mind: I have a form that contains a select with "onchange". Here is a part of this code:.

<form action="" method="get">.

<input type="hidden" name="shown" value="yes">.

<select name="fname" size=4 onchange="window.location.href=this.options[this.selectedIndex].value;">.

This of course is followed by code that generates options, etc..

This form allows to select and view a file. It works perfectly well under IE, but when I run it under Netscape, it returns an alert "c is not a registered protocol" when I attempt to view the selected file..

Javascript console displays the following:.

Error: uncaught exception: [Exception... "Component returned failure code: 0x804b0012 [nsIDOMLocation.href]" nsresult: "0x804b0012 (<unknown>)" location: "JS frame :: <unknown filename> :: onchange :: line 0" data: no].

Now, this apparently suggests I should have some code to handle exceptions. How should I do that? Or is there a way something can be done in browser's "Preferences"?.

Thanks..

Comments (12)

Yep, but... you might want to make sure and wait for another member to confirm it as I am not confident. Better yet, why don't you e-mail the iContact guys because they can answer you better...

Comment #1

It works from the standpoint of being able to select something. But once selected, the content of the file should be displayed. This is no problem under IE, but somehow Netscape does not recognize the file format (is it MIME type?). Is there something in Javascript that forces a known MIME type to be associated with the file extensions of these files?.

Thanks for validating the code in the form, though...

Comment #2

Hi there..

The code I posted does what you describe including loading the selected page..

What do the actual URLs you are selecting look like? They may contain characters causing the issue..

Don't use backslashes in the URL - that's a Microsoft only thing..

Not :.

\pages\mypage.htm.

But.

/images/mypage.htm.

Your error mentions 'c', that makes me think the URL contains a reference to your c drive and because you may be using Microsoft backslashes or too many forward slashes, for example, you will have a problem in anything but IE...

Comment #3

Im sorry what was that about only a M$ thing??.

/ is for URL as in protocol://URLaddress/location/file.htm.

And.

\ is for local machine drive: older ile.ext.

\ is also the escape character combo for use with \" \' \ for example when used in javascript strings...

Comment #4

Hi there..

\ is only used by MS for local machine paths, UNIX, OpenBSD, Linux etc use forward slashes for local and URL paths - if you are having your iContact site hosted on a non-Microsoft platform beware..

Microsoft platforms will take both types of slash so you may as well stick to the cross-platform, forward-slash approach - unless you are using absolute paths on a Microsoft platform..

Back slash is best reserved for escaping..

HTH..

Comment #5

.....But backslash is for Microsoft local paths so best avoided in favour of forward slash which is used for UNIX local paths and, of course, URLs :.

For example, if using absolute references, use.

<a href="C:/somefolder/somesubfolder/somefile.htm">Click</a>.

Instead of.

<a href="C:\somefolder\somesubfolder\somefile.htm">Click</a>.

To make it cross-platform (although UNIX-based systems would not have a drive letter)..

Comment #6

Just so that everyone knows, \'s are used for escaping, and as a folder delimiter on MICROSOFT OS's (windows, MS-DOS). The / is used for folder delimiting on everything else (linux, BSD, unix, and as a standard on the WEB)...

Comment #7

All right, here is exactly what I am generating:.

<form action="" method="get">.

<input type="hidden" name="shown" value="yes">.

<select name="fname" size=4 onchange="window.location.href=this.options[this.selectedIndex].value;">.

<option value="c:\project/some_directories/filea.tp">filea</option>.

<option value="c:\project/some_directories/fileb.prc">fileb</option>.

.....

.....

...etc....

<option value="c:\project/some_directories/filez.prc">filez</option>.

</select>.

</form>.

Now, what is wrong with it? Again, under IE I can display the content of "filea" (or any other specified as an option),.

But Netscape does not like the "protocol". Is there a way to hide "c:"? And yes, I tried using "c:/" instead of "c:\", with exactly the same result. I also tried things like "file://c:\", by the way...

Comment #8

If your serving up from your own machine, you have to put anything you wish to serve up within the servers scope, this means you would either add in a folder as an alias or as a folder within the servers root..

Your server addressing:-.

Protocol://domain:port/alias/location/file.ext <- Absoloute addressing.

/alias/location/file.ext <- relative addressing.

You need to specify relative addressing in URLs and these are anything past the 'protocol://domain:port' this leaves you with anything past the root / or the /alias root as shown above..

SO....

<option value="./project/some_directories/filea.tp">filea</option>.

Or.

<option value="/project/some_directories/filea.tp">filea</option>.

Should do what your looking to do, return a path thats relative in the value..

IM assuming that.

Http://www.yourserver.org/project/so...ories/filea.tp.

Is where the filea file exists...

Comment #9

If you want to keep the reference to the 'c' drive then this should work :.

<option value="file://C:/somefolder/somesubfolder/somepage.htm">Some page</option>.

[ Tested successfully on IE6, NN4, NN7 ]..

Comment #10

Yes but, if the page is on the internet in an ISP assigned webspace, the file://c:/ would be looking on the surfers machine c: for the file, thats why you bring items like that into the servers scope and apply a relative path or alias...

Comment #11

I changed to this format: "file://c:/directory/subdirectory/.../file.ext", as ElectricSheep suggested..

Now instead of the "c protocol" complaint, it simply does not display the file. Javascript console says:.

"Error: Access to 'file:///c:/directory/.../filea.tp' from script denied".

And.

"Error: uncaught exception: [Exception... "Access to restricted URI denied" code: "1012" nsresult: "0x805303f4 (NS_ERROR_DOM_BAD_URI)" location: "<unknown>"]"..

Again, this only happens with Netscape. I presume that senshi is right, there is a confusion between finding the file on the server or on the client. But why this does not bother the IE?.

Also, I may want to modify the DirectoryRoot value of "httpd" file for the Apache, to point to a place common to both where the application and files of interest (filea, etc) are located. Then I can switch to relative addressing...

Comment #12

This is actually now a security issue, Mozilla/Netscape doesn't allow linking to local files from Web content unless it is set up in your preferences file hence the access denied message..

If you are going to do this you'll need something like the line user_pref("security.checkloaduri", false); in your Netscape profile's user.js file..

IE does not currently impose the same level of strictness although it may do once you have installed SP2...

Comment #13


This question was taken from a support group/message board and re-posted here so others can learn from it.