473,327 Members | 2,090 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,327 software developers and data experts.

! location.pathname.lastIndexOf

But
something like: location.pathname.indexOf

I want to check if there in the path is a folder named 'travel'

tried this:

if (location.pathname.indexOf('travel')) zlang = 1;

:-(
Aug 19 '07 #1
2 2876
ok, found out:

if (location.pathname.indexOf('travel')!=-1)

But I don't want this "root" but everything behind that:

ie: travel\..

How do I get that ?

Aug 19 '07 #2
I want to check if there in the path is a folder named 'travel'

tried this:
if (location.pathname.indexOf('travel'))

But I want everything beneath the travel folder

ie: travel\..

How do I get that ?

Aug 19 '07 #3

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

Similar topics

1
by: Matt | last post by:
In test() method: var path="C:\test\hello.txt"; //returns -1 for path.lastIndexOf("\\"). why?? var pos=path.lastIndexOf("\\"); //return -1 But in showFile() method: We are able to get the...
8
by: Phil Powell | last post by:
if (document.location.href.indexOf('?') >= 0) document.location.href = document.location.href.substring(0, document.location.href.indexOf('?')); if (document.location.href.indexOf('#') >= 0) {...
6
by: Harry Riddle | last post by:
I am trying to modify someone else's XML code and I am having problems. They hard-coded the location of an xslt file in a database and I want to make the file a part of the project. How do I...
2
by: Graham | last post by:
I'm not very experienced with Javascript, and I'm trying to determin a current web page's path. If I use document.location, it returns http://domain.com/path/to/file I only want to see...
3
by: Terry Olsen | last post by:
I have a string that is approximately 600 characters. I need to divide up the string into 400 character chunks. I'm having trouble with using LastIndexOf. The following code returns a value of...
2
by: Jeff | last post by:
I'm very new to javascript and need only a small amount in an asp.net application I'm working on. I apologize if I'm not using the correct terminology to describe the problem. I got the code below...
5
by: soni2926 | last post by:
Hi, I have a pop up window, that window needs to refresh the parent window when opened, I'm doing the following: window.opener.location.href(window.opener.location.href); problem I'm having...
2
by: superunknownman | last post by:
I was trying to capture the pathname only when using var from= window.location.pathname; and I want to lose the filename. Is there another way for me to get just the path?
1
by: Laurencebpk | last post by:
Hello, I have the following code segment that creates a word document from Access VBA. Dim oWord As New.Application Dim strTN As String With oWord .Documents.Add...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
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: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
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)...
1
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
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....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.