473,657 Members | 2,661 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How do we get the name of the present page into a varible?

HI! How so get the name of the present page into a variable? I need it
because I need to attach it to a path so I can make others link to me.
My pages are in iframes.

Paul
Feb 25 '06 #1
23 1496
paul wrote on 25 feb 2006 in comp.lang.javas cript:
HI! How so get the name of the present page into a variable? I need it
because I need to attach it to a path so I can make others link to me.
My pages are in iframes.


var pathAndPage = location.href
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Feb 25 '06 #2
Greetings,

You can also use the following if you just want the page you are on
WITHOUT the rest of the URL.

<script>
var thisPath = window.location .pathname;
var thisPage = thisPath.substr ing(thisPath.la stIndexOf('/') + 1); //
current page
</script>

You would just use the vaiable "thisPage" to get the current page you
are on.

Hope this helps,

- Peter Schmalfeldt
Manifest Interactive

Feb 26 '06 #3
HI! Thanks for the reply, I think though I might need to trim it though. I
see that it give me the whole path and not just page name. so I have to
create a IF statement to check to see if a condition is true then trim out
the part that I don't want. I will have to repost as this is different than
this heading.

Paul

"Evertjan." <ex************ **@interxnl.net > wrote in message
news:Xn******** ************@19 4.109.133.242.. .
paul wrote on 25 feb 2006 in comp.lang.javas cript:
HI! How so get the name of the present page into a variable? I need it
because I need to attach it to a path so I can make others link to me.
My pages are in iframes.


var pathAndPage = location.href
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Feb 26 '06 #4
HI! Thanks for the reply, I will try it out, thanks again :)

Paul

"paul" <pa***********@ sympatico.ca> wrote in message
news:eK******** ***********@new s20.bellglobal. com...
HI! How so get the name of the present page into a variable? I need it
because I need to attach it to a path so I can make others link to me.
My pages are in iframes.

Paul

Feb 26 '06 #5
paul wrote on 26 feb 2006 in comp.lang.javas cript:
"Evertjan." <ex************ **@interxnl.net > wrote in message
news:Xn******** ************@19 4.109.133.242.. .
paul wrote on 25 feb 2006 in comp.lang.javas cript:
HI! How so get the name of the present page into a variable? I need
it because I need to attach it to a path so I can make others link
to me. My pages are in iframes.
var pathAndPage = location.href


[please do not toppost on usenet]
HI! Thanks for the reply, I think though I might need to trim it
though. I see that it give me the whole path and not just page name.
so I have to create a IF statement to check to see if a condition is
true then trim out the part that I don't want. I will have to repost
as this is different than this heading.


var pageOnly = location.href.r eplace(/.*\//,'')
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Feb 26 '06 #6
HI! What is top top posting? I use Outlook express and to reply I click on
Reply to Group when I am on the last response. and the news group that this
post is posted to is comp.lang.javas cript from my sympatico.ca provider.

Paul

"Evertjan." <ex************ **@interxnl.net > wrote in message
news:Xn******** ***********@194 .109.133.242...
paul wrote on 26 feb 2006 in comp.lang.javas cript:
"Evertjan." <ex************ **@interxnl.net > wrote in message
news:Xn******** ************@19 4.109.133.242.. .
paul wrote on 25 feb 2006 in comp.lang.javas cript:

HI! How so get the name of the present page into a variable? I need
it because I need to attach it to a path so I can make others link
to me. My pages are in iframes.

var pathAndPage = location.href


[please do not toppost on usenet]
HI! Thanks for the reply, I think though I might need to trim it
though. I see that it give me the whole path and not just page name.
so I have to create a IF statement to check to see if a condition is
true then trim out the part that I don't want. I will have to repost
as this is different than this heading.


var pageOnly = location.href.r eplace(/.*\//,'')
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Feb 27 '06 #7
Thank ! I will give it try. :)

Paul
"Manifest Interactive" <ma************ *****@gmail.com > wrote in message
news:11******** **************@ v46g2000cwv.goo glegroups.com.. .
Greetings,

You can also use the following if you just want the page you are on
WITHOUT the rest of the URL.

<script>
var thisPath = window.location .pathname;
var thisPage = thisPath.substr ing(thisPath.la stIndexOf('/') + 1); //
current page
</script>

You would just use the vaiable "thisPage" to get the current page you
are on.

Hope this helps,

- Peter Schmalfeldt
Manifest Interactive

Feb 27 '06 #8
paul wrote:
HI! What is top top posting? I use Outlook express and to reply I click on
Reply to Group when I am on the last response. and the news group that this
post is posted to is comp.lang.javas cript from my sympatico.ca provider.

You've just done it!

Apparently Outlook can be configured to append rather than prepend your
response.

--
Ian Collins.
Feb 27 '06 #9
Ian Collins wrote:
paul wrote:
[...] What is top top posting? I use Outlook express and to reply I click
on Reply to Group when I am on the last response. [...]


You've just done it!

Apparently Outlook can be configured to append rather than prepend your
response.


Outlook (Express) has many flaws (including Cc'ing to the newsgroup when
Followup-To: poster was set), but its default quotation setting is correct,
common to many newsreaders, and should not be changed. The text cursor is
placed above the quote so that a reasonable poster can go through the quote
from top to down, snip the parts he/she is not referring to, and include
the reply just below each of the (minimized) parts he/she is referring to.

<URL:http://netmeister.org/news/learn2quote.htm l>
HTH

F'up2 poster

PointedEars
Feb 28 '06 #10

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

Similar topics

3
4622
by: Bryan Wood | last post by:
I am developing a regisration page that will present a set of check boxes to the viewer. This list of checkboxes is developed from a list in a database so the amount and names of the boxes will change. This portion works just fine. The page content has a user name and password along with several sets of these checkboxes. All the form content of this page is presented in one form. The problem:
21
11359
by: TheKeith | last post by:
I heard that the name attribute is deprecated in html 4.01 strict. Is it recommended that you use the ID attribute for images along with the getElementById method instead of the old way? Thanks.
11
3018
by: Andrew Thompson | last post by:
I have written a few scripts to parse the URL arguments and either list them or allow access to the value of any parameter by name. <http://www.physci.org/test/003url/index.html> <http://www.physci.org/test/003url/index.html?url=http://mybiz.com/&that=this&when=now#21> <http://www.physci.org/test/003url/index.html?url=http://mybiz.com/&when=now> Before I go offering it in public (and writing it into any number of the 'development kits'...
3
4210
by: The Dana's | last post by:
I need to create a static HTML file that runs only on the local client PC. On the page (say PageA.htm), I would like for a hypelink to another page (Page B) to appear ONLY if the target file the hyperlink references is present (PageB.htm). So If I'm viewing page A, and Page B is present, then I want a hyperlink to show up on Page A to navigate to Page B. If Page B is not present, then no hypelink would appear for Page B.
17
42313
by: piraticman | last post by:
Hi. I have some code for a javascript jump menu... It validated with HTML 4.0 but now does not validate with XHTML strict 1.0. I have used name atributes in my code which aparantly are not allowed now. I have spent all day trying to figure out a solution with no luck. I have tried document.forms and various other things but havent known exactly what to do with them and couldn't get them to work. Below I will show you my current code and...
4
10895
by: John | last post by:
Hi, is it possible for a UserControl to get the Page name and querystring of its parent? e.g If a userControl is inside a page called "index.aspx?ID=66" how can a usercontrol print out this value? I was hoping there might be a Parent.PageName or Parent.Querystring method :) Thanks in advance John
0
1165
by: yoshra | last post by:
i want to edit form and submit (post) it to another server. the name value contain char that cannot be inisde varible name in .net "xxx" so i gave those inputtypehidden diffrent name and diffrent id but when the html go to the client it change the name of inputtypehidden to the id also i am using user control so name is totally diffrent..
2
1397
by: salportaro | last post by:
Hello: Here is the situation. VB.NET I have several forms and I have a XML file that can start with a particular for for debugging/layout reasons. This is a mdi project. Normaly you would load a form as follows: Dim frmT As frmTrans frmT = New frmTrans
3
1425
by: Sachin | last post by:
Hi Folks, I have one query in regarding const varible interpretaion by C/C++ compiler. How Compiler actually differentiate between normal stack varible and const varible during program execution? Regards, Sachin
0
8837
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8739
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
8512
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
8612
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
6175
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
4171
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
4329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2739
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1969
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.