473,320 Members | 1,823 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

please verivy this code

Can u please verify if this code works on a MAC and or PC?

test.htm?hello.jpg ( should see save thing on PC and MAC)
test.htm?hello.png ( should see save thing on PC and MAC)
test.htm?hello.ppt ( should see save thing on PC but not on MAC)
test.htm?hello.pdf ( shouldn't see save thing on PC and MAC)
test.htm?hello.doc ( shouldn't see save thing on PC and MAC)
tnx
/// TEST.HTM ///
document.write('<table>')
var save = (location.search ? location.search.substring(1) : '');
var notmac = navigator.userAgent.indexOf("Mac")==-1
if (notmac && save.indexOf(".ppt") >= 0 || save.indexOf(".png") >= 0 ||
save.indexOf(".jpg") >= 0)
{
// PC
document.write('<tr valign="middle" align="left">')
document.write('<td colspan="2"><br></td>')
document.write('</tr>')
document.write('<tr valign="middle" align="left">')
document.write('<td height="32"><img src="../../images/dot.gif" width="32"
height="1" alt="" border="0"><a href="../../images/ap/' + save + '"
target="_new" class="nav"><img src="../../images/save.gif" width="32"
height="32" alt="" border="0"></a></td><td>&nbsp;&nbsp;<a
href="../../images/ap/' + save + '" target="_new" class="nav">Klik
rechtermuisknop om te bewaren</a></td>')
document.write('</tr>')
}
else if (save.indexOf(".png") >= 0 || save.indexOf(".jpg") >= 0)
{
// MAC
document.write('<tr valign="middle" align="left">')
document.write('<td colspan="2"><br></td>')
document.write('</tr>')
document.write('<tr valign="middle" align="left">')
document.write('<td height="32"><img src="../../images/dot.gif" width="32"
height="1" alt="" border="0"><a href="../../images/ap/' + save + '"
target="_new" class="nav"><img src="../../images/save.gif" width="32"
height="32" alt="" border="0"></a></td><td>&nbsp;&nbsp;<a
href="../../images/ap/' + save + '" target="_new" class="nav">"CTRL" +
rechtermuisknop om te bewaren</a></td>')
document.write('</tr>')
}
else {}
document.write('</table>')
Jul 20 '05 #1
2 1530
While the city slept, ziemon <ne**@ziemon.nl> feverishly typed:
var notmac = navigator.userAgent.indexOf("Mac")==-1
if (notmac && save.indexOf(".ppt") >= 0 || save.indexOf(".png") >= 0


What happens if I am using a *nix machine? Or any of the other many and
varied non-windows/non-mac OS's out there?

Cheers,
Nige

--
Nigel Moss.

Email address is not valid. ni***@nigenetDOG.org.uk. Take the dog out!
http://www.nigenet.org.uk | Boycott E$$O!! http://www.stopesso.com
"How strange the change from major to minor..."
Jul 20 '05 #2
IF the code works and if it's not mac u should see the picture ( which is
not there ) and some txt at "file.ppt" "file.png" and "file.jpg"
"nice.guy.nige" <ni********@deadspam.com> wrote in message
news:bj************@ID-112325.news.uni-berlin.de...
While the city slept, ziemon <ne**@ziemon.nl> feverishly typed:
var notmac = navigator.userAgent.indexOf("Mac")==-1
if (notmac && save.indexOf(".ppt") >= 0 || save.indexOf(".png") >= 0


What happens if I am using a *nix machine? Or any of the other many and
varied non-windows/non-mac OS's out there?

Cheers,
Nige

--
Nigel Moss.

Email address is not valid. ni***@nigenetDOG.org.uk. Take the dog out!
http://www.nigenet.org.uk | Boycott E$$O!! http://www.stopesso.com
"How strange the change from major to minor..."

Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Az Tech | last post by:
Hi people, (Sorry for the somewhat long post). I request some of the people on this group who have good experience using object-orientation in the field, to please give some good ideas for...
2
by: rked | last post by:
I get nameSPAN1 is undefined when I place cursor in comments box.. <%@ LANGUAGE="VBScript" %> <% DIM ipAddress ipAddress=Request.Servervariables("REMOTE_HOST") %> <html> <head> <meta...
7
by: x muzuo | last post by:
Hi guys, I have got a prob of javascript form validation which just doesnt work with my ASP code. Can any one help me out please. Here is the code: {////<<head> <title>IIBO Submit Page</title>...
23
by: Jason | last post by:
Hi, I was wondering if any could point me to an example or give me ideas on how to dynamically create a form based on a database table? So, I would have a table designed to tell my application...
13
by: Joner | last post by:
Hello, I'm having trouble with a little programme of mine where I connect to an access database. It seems to connect fine, and disconnect fine, but then after it won't reconnect, I get the error...
1
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej...
5
by: settyv | last post by:
Hi, Below is the Javascript function that am trying to call from asp:Button control. <script language="javascript"> function ValidateDate(fromDate,toDate) { var fromDate=new Date();
1
PEB
by: PEB | last post by:
POSTING GUIDELINES Please follow these guidelines when posting questions Post your question in a relevant forum Do NOT PM questions to individual experts - This is not fair on them and...
4
by: fatboySudsy | last post by:
Hi, I have constructed a client program that has given me some error codes that i just cannot see. I was wondering if a different set of eyes with much more experience than me could help me out. ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.