473,323 Members | 1,560 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,323 software developers and data experts.

Change the domain, keep the path..with javascript?

Hello:

I'm currently at http://www.domain.com/the-path.jsp, and I would like
to be able, with JavaScript--and possibly the click of a button, which
I will most likely attach to IE's toolbar--transport to
http://domain.dev.domain.com/the-path.jsp.

Here's the environment: My browser is set to the page http://www.domain.com/the-path.jsp
and I plan to add a button to IE's toolbar via the registry that I
would like to execute the JavaScript, which contain the code to
perform the aforementioned procedure.

My JavaScript knowledge is, as I'm sure you've already surmised,
limited.

Here's what I know (or what I think I know)

The .js file header:
oShell= new
ActiveXObject("WScript.Shell");

the object: window.location.replace [or href].

I have a feeling a "and if" statement is needed here. Am I correct?

BTW: As far as the registry button addition is concerned, I'm set on
how to do that.

Thank you in advance for your time and attention.

May 25 '07 #1
2 11678
On May 25, 10:13 am, Danny <email.danny.yo...@gmail.comwrote:
Hello:

I'm currently athttp://www.domain.com/the-path.jsp, and I would like
to be able, with JavaScript--and possibly the click of a button, which
I will most likely attach to IE's toolbar--transport tohttp://domain.dev.domain.com/the-path.jsp.

Here's the environment: My browser is set to the pagehttp://www.domain.com/the-path.jsp
and I plan to add a button to IE's toolbar via the registry that I
would like to execute the JavaScript, which contain the code to
perform the aforementioned procedure.

My JavaScript knowledge is, as I'm sure you've already surmised,
limited.

Here's what I know (or what I think I know)

The .js file header:
oShell= new
ActiveXObject("WScript.Shell");

the object: window.location.replace [or href].

I have a feeling a "and if" statement is needed here. Am I correct?

BTW: As far as the registry button addition is concerned, I'm set on
how to do that.

Thank you in advance for your time and attention.
Here's something quick:

var url = window.location;
url = url.toString();
url = url.replace(/www.domain.com/,"domain.dev.domain.com")
window.location = url;

-RYAN

May 25 '07 #2
On May 25, 1:01 pm, atxryan <atxr...@gmail.comwrote:
On May 25, 10:13 am, Danny <email.danny.yo...@gmail.comwrote:


Hello:
I'm currently athttp://www.domain.com/the-path.jsp, and I would like
to be able, with JavaScript--and possibly the click of a button, which
I will most likely attach to IE's toolbar--transport tohttp://domain.dev.domain.com/the-path.jsp.
Here's the environment: My browser is set to the pagehttp://www.domain.com/the-path.jsp
and I plan to add a button to IE's toolbar via the registry that I
would like to execute the JavaScript, which contain the code to
perform the aforementioned procedure.
My JavaScript knowledge is, as I'm sure you've already surmised,
limited.
Here's what I know (or what I think I know)
The .js file header:
oShell= new
ActiveXObject("WScript.Shell");
the object: window.location.replace [or href].
I have a feeling a "and if" statement is needed here. Am I correct?
BTW: As far as the registry button addition is concerned, I'm set on
how to do that.
Thank you in advance for your time and attention.

Here's something quick:

var url = window.location;
url = url.toString();
url = url.replace(/www.domain.com/,"domain.dev.domain.com")
window.location = url;

-RYAN- Hide quoted text -

- Show quoted text -
Thanks for that code. Would you give me a brief explanation of how I
would execute that from outside the page being viewed. That is, I
would like to execute it by double-clicking a JS or HTML file, if it's
possible.

Thanks for your continued time and attention.

Jun 12 '07 #3

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

Similar topics

0
by: Gowhera Hussain | last post by:
Use This for Learning Only .... Do Not Try To Act Smart HACKING WITH JAVASCRIPT Dr_aMado Sun, 11 Apr 2004 16:40:13 UTC This tutorial is an overview of how javascript can be used to bypass...
111
by: Retlak | last post by:
The recommended (on dozens of websites) and effective (works in Netscape, MSIE, Mozilla, probably others) way to detect if a browser has Javascript turned off is to put this in the <head>: ...
1
by: Julius Mong | last post by:
Dear all, according to the ASV3 manual known problem section, to make an <a> execute some Javascript onclick: ...
4
by: Wolfgang Adamec | last post by:
Hello everybody! I had no experience with cookies up to today. I read about the properties of cookies. Then I started to write a few lines of Javascript into my html-page: function...
1
by: Antonio | last post by:
Hi, in my page's <body tag>'s "onload" javascript event I want to call a javascript method that will change the selected index of a drop down list. I want it to happen every time the page gets...
2
by: Radu | last post by:
Hi. I have files in the "Scorecard Previews" subfolder of the virtual path of my app, the absolute path being C:\Data\Ordering Process\Scorecard Previews\ I have a javascript function...
1
by: Simon Wigzell | last post by:
I have a picture gallery webpage. Naturally I want as much space as possible for the pictures but with browsers these days the actual available area is only 2/3 - 3/4 of the total window. So I have...
2
by: purebuilt | last post by:
Hello all, I have a variable 'css' that reads a url for a style sheet. I need to add the 'css' style sheet to the cascade using JavaScript. Is there a clean way to do that? Thanks. DB
4
by: Peter | last post by:
I have a DataList and each item in the datalist has an imge, I want to change the datalist item image on the client side when user clicks a button. How would I do that with JavaScript, does anyone...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
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...
1
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: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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.