473,511 Members | 15,046 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

replace address bar url to another

Fary4u
273 Contributor
Hi

i'm trying 2 open a popup windows, but problem whn it's opening it's url address is like this

- > http://www.mysite.com/order.asp?value=32

there is no problem with this what i would like to do is
replace only the address bar into this

- > http://www.mysite.com/

and result gonna be the 1st url with the value only showing it ?
any body know how 2 do the job ? thxs in advance.
Mar 20 '09 #1
8 3716
hsriat
1,654 Recognized Expert Top Contributor
Window.location and RegExp can help you.
Mar 20 '09 #2
acoder
16,027 Recognized Expert Moderator MVP
If you set window.location, it will redirect to a new page. You could use a frame/iframe on the page and set it to the desired location.
Mar 21 '09 #3
Fary4u
273 Contributor
Hi thxs 4u reply, could u explain it how coz i've tryed it but still struggling to do this kind of job.

i don't care it's popup or new windows but main query is

i wanna replace 1st link to 2nd link
but keep executed the 1st link.

1st link - > http://www.mysite.com/order.asp?value=32

2nd link - >http://www.mysite.com/
Mar 23 '09 #4
Fary4u
273 Contributor
hi any body knws how 2 do this ?
thanks in advance
Mar 26 '09 #5
hsriat
1,654 Recognized Expert Top Contributor
Well, I can't understand what you trying to achieve, but you might find this useful:
Expand|Select|Wrap|Line Numbers
  1. var locationPattern = /^http\:\/\/[a-zA-Z0-9\.]+\//;
  2. var base = locationPattern.exec(location.href);
Now use the base variable where ever you want.
Mar 26 '09 #6
iam_clint
1,208 Recognized Expert Top Contributor
The functionality this user is trying to accomplish is not possible.

How I interpreted
Example:
You are viewing www.somesite.com/blah.php?a=1
But make the address bar show:
www.somesite.com


You can do this with some serverside coding to call those scripts and do a redirect back to main page passing some information in session about what page they were wanting to view and pull those files.. but javascript based would violate some security.. example of doing this has been done before but its malicious using a popup window to display directly over the address bar to make you think you are on x page
Mar 27 '09 #7
Amzul
130 New Member
ummm .htaccess file can come handy here, trim all the url and live just the host name.
if you like to get only the host name in javascript try
var url = location.hostname
Mar 28 '09 #8
acoder
16,027 Recognized Expert Moderator MVP
If you want a JavaScript solution, open the pop-up window with the home page (with a full window frame) and then set the location from the parent (opening) window.
Mar 28 '09 #9

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

Similar topics

5
36365
by: Mark Kamoski | last post by:
Hi-- How can one replace the URL in the address bar to a "friendly alternative"? Is there a way to do this with JavaScript? Is there a way to do this ASP.NET? For example, suppose I...
2
14886
by: Daniel | last post by:
I use an Access database to basically take data exports, import them, manipulate the data, and then turn them into exportable reports. I do this using numerous macros, and queries to get the data...
2
1649
by: Mark Kamoski | last post by:
Hi-- How can one replace the URL in the address bar to a "friendly alternative"? Is there a way to do this with JavaScript? Is there a way to do this ASP.NET? For example, suppose I...
18
4582
by: james | last post by:
Hi, I am loading a CSV file ( Comma Seperated Value) into a Richtext box. I have a routine that splits the data up when it hits the "," and then copies the results into a listbox. The data also...
10
13913
by: localpricemaps | last post by:
i have some html that looks like this <address style="color:#">34 main,<br> Boston, MA</address> and i am trying to use the replace function to get rid of the <Br> that i scrape out using...
8
5914
by: Captain Dondo | last post by:
I have an array(?) (sorry, I'm new* to python so I'm probably mangling the terminology) that looks like this: I want to replace every instance of 'tooth.seiner.lan' with 'localhost'. There...
5
3215
by: MoslyChang | last post by:
Hi, All When I look at effective c++,item2 and item3. I have some basic questions , Does anyone be familar with this topic? it suggests const is perfer to #define, then I think how to replace...
5
1622
by: JX | last post by:
Is it possible to replace the address in client browser for server.transfer with the the real location?
3
10019
by: Ned White | last post by:
Hi All, To replace some substrings in a string value, i use Regex.Replace method mulptiple times like; strmemo = "new Data for user; Name:@@Name , Surname:@@Surname, Address:@@Address";...
0
7237
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7137
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...
0
7349
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,...
0
7417
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...
0
4734
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...
0
3210
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1572
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 ...
1
780
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
445
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...

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.