473,385 Members | 1,919 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,385 software developers and data experts.

Path seperator different on two computers using same script

I have a javascript that looks for the path location in which the script is running. When I use an
Expand|Select|Wrap|Line Numbers
  1.  alert path 
most computers report in a format that use backslashes as the path separators. On one of the computers I have used this script on it reports slashes as the separator.

eg: most computers report - "C:\database\test\..."

one computer reports - "C/:database/test/..."

The code I use to get the path is

Expand|Select|Wrap|Line Numbers
  1.  var path = location.pathname 
Would this be a script error or a machince/windows problem. Both computer are running up to date service packs and either Explorer 6 or 7 and have the same "Regional settings" setup on them.

I have looked through the forums but I am really unsure of what this problem is call as I am not that familiar with programming.
May 15 '07 #1
1 1203
mrhoo
428 256MB
If you need them to be the same -

if(/file/.test(location.protocol)){
path=location.pathname.replace(/\\/g,'/');
}
May 16 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

70
by: Michael Hoffman | last post by:
Many of you are familiar with Jason Orendorff's path module <http://www.jorendorff.com/articles/python/path/>, which is frequently recommended here on c.l.p. I submitted an RFE to add it to the...
6
by: david epsom dot com dot au | last post by:
I have a report with an OLE bound frame. A bitmap has been pasted into the bound field. The bitmap displays and prints differently on different computers. In particular, the alignment is...
6
by: dale zhang | last post by:
Hi, I build a web form with a 4-cell table on the top (flawlayout), followed by some labels and textboxes (gridlayout). The web form is displayed well in dell m60 laptop with all resolution...
1
by: Patrick Olurotimi Ige | last post by:
Using this location path below it relates only to the ADMINSITE folder/Directory only. Which allows only Admin Groups to the "AdminSite" directory. But if i try using ADMIN\AdminSite in the...
2
by: Sridhar | last post by:
Hi, I have a web form where it has a <input type=file id=file1> control. I have an Upload button to upload the file. WHen I click on browse and select one file, it is showing the full file path...
9
by: kyle | last post by:
I have many users using two different versions of python, 2.4 and 2.5. I am running Python scripts on their computers programmatically, but I can't run it with the full path because they have...
4
by: Vlad | last post by:
I am having problems using the file.create method within a function that is called when looping through an array of filepaths. If I call my function with a hardcoded file path --C:\Temp.txt the...
3
by: zhf | last post by:
I want ro walk a directory and its sub directory on linux, to find some shell script file, and run them, but I found some path belong blank charactor, such as '8000 dir', if I write as follow, I...
18
by: Aaron Gray | last post by:
Has anyone got a code snippet to separate out the path components, ie drive, path, filename, and extension ? Many thanks in advance, Aaron
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.