473,585 Members | 2,512 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 3718
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.hostna me
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
36375
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 have a site that has the URL...
2
14900
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 in the format that I need it in order to create the reports that we use. So far this has proven to be successful for the reports that I am doing and...
2
1650
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 have a site that has the URL...
18
4607
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 has some different characters in it that I am trying to remove. The small a with two dots over it and the small y with two dots over it. Here is my...
10
13937
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 this code: for oText in incident.fetchText( oRE): strTitle += oText.strip()
8
5919
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 may be lots and lots of these entries (they're pulled from my mythtv database). I could brute-force this by rewriting the whole thing and replacing
5
3219
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 #define with const. example: 2 header file StringGrid1.h StringGrid2.h
5
1626
by: JX | last post by:
Is it possible to replace the address in client browser for server.transfer with the the real location?
3
10032
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"; strmemo = Regex.Replace(strmemo,"@@Name", value1.ToString()); strmemo = Regex.Replace(strmemo,"@@Surname", value2.ToString()); strmemo =...
0
7908
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7836
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...
0
8336
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...
1
7950
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...
0
6606
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5389
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...
0
3835
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...
0
3863
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1175
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...

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.