473,666 Members | 2,073 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

! location.pathna me.lastIndexOf

But
something like: location.pathna me.indexOf

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

tried this:

if (location.pathn ame.indexOf('tr avel')) zlang = 1;

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

if (location.pathn ame.indexOf('tr avel')!=-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.pathn ame.indexOf('tr avel'))

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
16345
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 filename. The only difference is test() hardcode the path, but in showFile() we gets the path from the file dialog.
8
8219
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) { document.location.href = document.location.href.substring(0, document.location.href.indexOf('#')) + '?' + newUrl; } else { document.location.href = document.location.href + '?' + newUrl; }
6
2041
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 reference the project file in xslt.run(string PathName) without it looking in c:\windows\system32 directory for the file? -- Thanks, Harry
2
8950
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 /path/to/file How do I do this?
3
3508
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 594. value=msg(i).LastIndexOf(" "c) The following code returns a value of -1 value=msg(i).LastIndexOf(" "c,1)
2
8756
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 to work under most conditions to capture the client's screen resolution and then redirect to another page (but there likely are better ways to code this). This needs to work under 3 conditions; A) if the current top.location.href is similar to...
5
12891
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 is that the parent url has a # sign in it, like: http://localhost/mysite/me.html#01 i need the #01 to stay in the url after the refresh, anyway to do
2
10048
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
2201
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 "\\ServerName\Fred\Templates\Fred.dot"
0
8356
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8783
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8552
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8640
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6198
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5666
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4198
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4369
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1776
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.