Re: Button to support both IE and Firefox
> Amongst trying out your code I realized the target site no longer > available. I appreciate it very much though. No problem - hopefully there is some useful general advice in this thread anyway. :) ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:321274 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Button to support both IE and Firefox
Peter, Amongst trying out your code I realized the target site no longer available. I appreciate it very much though. Don > >two things I can see ... > >Should width= not be width: ? > > Yes, since inside the style="..." attribute you are using CSS, and CSS > does not use = to delimit properties and values. > > > > >Does onclick need the semicolon ; ? > > Makes no difference. Again, inside onclick you are using JS, which > generally accepts the command terminator (semi-colon) to be skipped > when it is not necessary. > > > > > Try adding a 'return false' to the onclick. > > The purpose of 'return false' is to cancel whatever default event was > occurring: > - if a link was clicked then the browser will not follow the href > - if a form was submitted this action will be cancelled > - if an input value was changed, the value will be reverted > etc. > > Since this is a generic button, it has no default event, so returning > false has nothing to prevent from occuring. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:321264 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Button to support both IE and Firefox
Thank you, Peter. I'll try it tonight and update you folks then. > Don, the following code should work in all major browsers - certainly > I've tested in Firefox 3, IE7, Chrome, and Opera 9. > > > Here's the HTML: > > http://xyz. > com/somefile.zip">Download the File > > > Note how I've used a class there - instead of inline styles - here is > the styling: > > > button.download > { > background-color: lightgreen; > width: 150px; > } > > > > Finally, here is the scripting to use: > > http://ajax.googleapis. > com/ajax/libs/jquery/1.3.2/jquery.min.js"> > > $j = jQuery.noConflict(); > > $j(document).ready > ( function() > { > $j('.download').click( downloadFile ); > } > ); > > function downloadFile() > { > location.href = $j(this).attr('data-file'); > } > > > > This is all a lot of code, but it is a more reliable/flexible way of > doing it, especially for when (not if) you need to extend things. > > Feel free to ask if any of this is unclear. :) ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:321222 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Button to support both IE and Firefox
location.href= was correct, although it could be window.location.href= - Original Message - From: "Don L" To: "cf-talk" Sent: Wednesday, April 01, 2009 6:25 PM Subject: Re: Button to support both IE and Firefox > > Yeah, you all, good catch on width= instead of width: > also, there's a semicolon for the onclick event, still to no avail. > hmmm... thks. > >>I missed that but yes, width= should be width:. Here's the code that it >>should be: >> >>>onclick="window.location='http://xyz.com/somefile.zip';" value=" Download >>the File "> >> >>HEXVAL should be the actual Hex value of the lightgreen color that you are >>looking for. >> >>>onclick="location.href='http://xyz.com/somefile.zip';" value=" Download >>the >>File "> >> >>two things I can see ... >>Should width= not be width: ? >>Does onclick need the semicolon ; ? > > ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:321207 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Button to support both IE and Firefox
> a plain href link to the file won't work neither... This suggests it's more an issue with the file/server/network, not the method you are getting it with (however, still see my reply dated "04/01/2009 01:12 PM" for a superior solution). Without more details on what the real file is, we wont be able to help find out why it is downloadable in some browsers but not others. If you're unable to share this detail, you could get a HTTP monitor to see if the browsers are sending different requests to the server, and if so what impact that might be having. Of course, this assumes you are testing with multiple browsers on the same machine and no proxies are involved already. If the file is behind some sort of firewall and IE is going through a proxy whilst Firefox has a direct connection, that could be the problem. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:321191 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Button to support both IE and Firefox
>two things I can see ... >Should width= not be width: ? Yes, since inside the style="..." attribute you are using CSS, and CSS does not use = to delimit properties and values. >Does onclick need the semicolon ; ? Makes no difference. Again, inside onclick you are using JS, which generally accepts the command terminator (semi-colon) to be skipped when it is not necessary. > Try adding a 'return false' to the onclick. The purpose of 'return false' is to cancel whatever default event was occurring: - if a link was clicked then the browser will not follow the href - if a form was submitted this action will be cancelled - if an input value was changed, the value will be reverted etc. Since this is a generic button, it has no default event, so returning false has nothing to prevent from occuring. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:321190 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Button to support both IE and Firefox
>Try adding a 'return false' to the onclick. > >Adrian Too bad, nope. Also, a plain href link to the file won't work neither... thks though ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:321189 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Button to support both IE and Firefox
Don, the following code should work in all major browsers - certainly I've tested in Firefox 3, IE7, Chrome, and Opera 9. Here's the HTML: http://xyz.com/somefile.zip";>Download the File Note how I've used a class there - instead of inline styles - here is the styling: button.download { background-color: lightgreen; width: 150px; } Finally, here is the scripting to use: http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js";> $j = jQuery.noConflict(); $j(document).ready ( function() { $j('.download').click( downloadFile ); } ); function downloadFile() { location.href = $j(this).attr('data-file'); } This is all a lot of code, but it is a more reliable/flexible way of doing it, especially for when (not if) you need to extend things. Feel free to ask if any of this is unclear. :) ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:321188 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Button to support both IE and Firefox
lightgreen is a perfectly valid value for background-color!!! Moreover, it has ***absolutely no effect*** on whether the button onclick works or not - invalid colours are simply ignored. ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:321187 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Button to support both IE and Firefox
Try adding a 'return false' to the onclick. Adrian > -Original Message- > From: Don L [mailto:do...@yahoo.com] > Sent: 01 April 2009 18:25 > To: cf-talk > Subject: Re: Button to support both IE and Firefox > > > Yeah, you all, good catch on width= instead of width: > also, there's a semicolon for the onclick event, still to no avail. > hmmm... thks. > > >I missed that but yes, width= should be width:. Here's the code that > it > >should be: > > > > >onclick="window.location='http://xyz.com/somefile.zip';" value=" > Download > >the File "> > > > >HEXVAL should be the actual Hex value of the lightgreen color that you > are > >looking for. > > > > >onclick="location.href='http://xyz.com/somefile.zip';" value=" > Download the > >File "> > > > >two things I can see ... > >Should width= not be width: ? > >Does onclick need the semicolon ; ? ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:321186 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Button to support both IE and Firefox
Yeah, you all, good catch on width= instead of width: also, there's a semicolon for the onclick event, still to no avail. hmmm... thks. >I missed that but yes, width= should be width:. Here's the code that it >should be: > >onclick="window.location='http://xyz.com/somefile.zip';" value=" Download >the File "> > >HEXVAL should be the actual Hex value of the lightgreen color that you are >looking for. > >onclick="location.href='http://xyz.com/somefile.zip';" value=" Download the >File "> > >two things I can see ... >Should width= not be width: ? >Does onclick need the semicolon ; ? ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:321182 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Button to support both IE and Firefox
I missed that but yes, width= should be width:. Here's the code that it should be: http://xyz.com/somefile.zip';" value=" Download the File "> HEXVAL should be the actual Hex value of the lightgreen color that you are looking for. -Original Message- From: BobSharp [mailto:bobsh...@ntlworld.com] Sent: Wednesday, April 01, 2009 11:05 AM To: cf-talk Subject: Re: Button to support both IE and Firefox http://xyz.com/somefile.zip';" value=" Download the File "> two things I can see ... Should width= not be width: ? Does onclick need the semicolon ; ? - Original Message - From: "Jake Churchill" To: "cf-talk" Sent: Wednesday, April 01, 2009 4:29 PM Subject: RE: Button to support both IE and Firefox > > Try swapping out "lightgreen" with the hex value of that color and add > "px" > after 150 and it'll probably work fine. > > -Original Message- > From: Don L [mailto:do...@yahoo.com] > Sent: Wednesday, April 01, 2009 11:16 AM > To: cf-talk > Subject: Button to support both IE and Firefox > > > The following code for Button triggered download works with IE7 (hopefully > IE6 & 8 as well) but not FireFox3, do you know how to make it supports > both > browsers? Getting rusty on this kind of stuff... Thanks. > > Don > > onclick="location.href='http://xyz.com/somefile.zip';" value=" Download > the > File "> > > > > ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:321181 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Button to support both IE and Firefox
http://xyz.com/somefile.zip';" value=" Download the File "> two things I can see ... Should width= not be width: ? Does onclick need the semicolon ; ? - Original Message - From: "Jake Churchill" To: "cf-talk" Sent: Wednesday, April 01, 2009 4:29 PM Subject: RE: Button to support both IE and Firefox > > Try swapping out "lightgreen" with the hex value of that color and add > "px" > after 150 and it'll probably work fine. > > -Original Message- > From: Don L [mailto:do...@yahoo.com] > Sent: Wednesday, April 01, 2009 11:16 AM > To: cf-talk > Subject: Button to support both IE and Firefox > > > The following code for Button triggered download works with IE7 (hopefully > IE6 & 8 as well) but not FireFox3, do you know how to make it supports > both > browsers? Getting rusty on this kind of stuff... Thanks. > > Don > > onclick="location.href='http://xyz.com/somefile.zip';" value=" Download > the > File "> > > > > ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:321180 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Re: Button to support both IE and Firefox
Too bad, neither techniques works. I bet it may have something to do with the way the xyz.com/somefile.zip is set up, but it would be good that I'm wrong in this, save some hassle. > try onclick="window.location.href='http://xyz.com/somefile.zip'" > > Azadi Saryev > Sabai-dee.com > http://www.sabai-dee.com/ > > > > Don L wrote: > > The following code for Button triggered download works with IE7 > (hopefully IE6 & 8 as well) but not FireFox3, do you know how to make > it supports both browsers? Getting rusty on this kind of stuff... > Thanks. > > > > Don > > > > onclick="location.href='http://xyz.com/somefile.zip';" value=" > Download the File "> > > ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:321179 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Button to support both IE and Firefox
try onclick="window.location.href='http://xyz.com/somefile.zip'" Azadi Saryev Sabai-dee.com http://www.sabai-dee.com/ Don L wrote: > The following code for Button triggered download works with IE7 (hopefully > IE6 & 8 as well) but not FireFox3, do you know how to make it supports both > browsers? Getting rusty on this kind of stuff... Thanks. > > Don > > onclick="location.href='http://xyz.com/somefile.zip';" value=" Download the > File "> > ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:321176 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Button to support both IE and Firefox
Try swapping out "lightgreen" with the hex value of that color and add "px" after 150 and it'll probably work fine. -Original Message- From: Don L [mailto:do...@yahoo.com] Sent: Wednesday, April 01, 2009 11:16 AM To: cf-talk Subject: Button to support both IE and Firefox The following code for Button triggered download works with IE7 (hopefully IE6 & 8 as well) but not FireFox3, do you know how to make it supports both browsers? Getting rusty on this kind of stuff... Thanks. Don http://xyz.com/somefile.zip';" value=" Download the File "> ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:321175 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Button to support both IE and Firefox
The following code for Button triggered download works with IE7 (hopefully IE6 & 8 as well) but not FireFox3, do you know how to make it supports both browsers? Getting rusty on this kind of stuff... Thanks. Don http://xyz.com/somefile.zip';" value=" Download the File "> ~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;207172674;29440083;f Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:321174 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4