?
Solved

How to get window.open to open a page in current subdirectory in HTTPS environment

Posted on 2012-08-28
4
Medium Priority
?
611 Views
Last Modified: 2012-09-03
I have a script running in an HTTPS site and I am unable to figure out how to use window.open to open a new page from the current subdirectory.  I've tried eveything to make the url appropriate, including hardcoding it.  All work in LOCALHOST which is not protected by HTTPS.  Here's a code snippet.  It sets the URL properly, but for some reason in the production HTTPS environment, it goes to the root directory and uses the parameters I give it, but with no page name.
//var urlscript = "http://" + window.location.host + "/^a/mox_accuInventoryGrid";
  var urlscript = window.location.protocol + "//" + window.location.host + "/^a/mox_accuInventoryGrid";
  //var urlscript = "^a/mox_accuInventoryGrid";
  var cb = Math.floor(Math.random()*3200);
  var parms = "?col="+col+
              "&row="+row+                      // MUST BE DEFINED IN SAME ORDER AS PARAMS COMING IN
              "&value="+value+                  // value of clicked on category, ie: SUN, IBM, ALLEN, etc
              "&category="+category+            // click on series (mfg, model, etc)
              "&series="+series+                    // mmmyyyy
              "&id="+id+                                 // DOM id of chart
              "&datelow="+datelow+              // filters low date
              "&datehigh="+datehigh+            // filters high date
              "&usermail="+usermail+            // filters high date
              "&cb="+cb;                        // cache buster must be last
  var url = urlscript+parms;
  alert("url-  "+url);
  var winopts = 'width='+screenwidth+',height='+screenheight+',left=0,top=0,scrollbars=1,menubar=0,toolbar=0,location=0,resizable=1,status=0,directories=0,copyhistory=0';
  invdetwin=window.open(url,'_blank',winopts);

Open in new window

0
Comment
Question by:mamuscia
  • 2
4 Comments
 
LVL 44

Expert Comment

by:Rainer Jeschor
ID: 38344946
Hi,
the script should in general work regardless of HTTP / HTTPS.
In what web server / framework do you host that site (source page where the script resides on)?
How does the script get invoked / called?
Any firewalls in between the browser and the web server?
The special char "^" in the url might be blocked by some firewalls.

HTH
Rainer
0
 
LVL 17

Expert Comment

by:jrm213jrm213
ID: 38345217
In the production environment do you have url rewriting going on in something like an apache .htaccess file or an iis filter or web config?
0
 

Accepted Solution

by:
mamuscia earned 0 total points
ID: 38345353
Sorry but I am removing this question from here as I have discovered that other pages open fine in this manner.  I believe I have an issue with the actual page that is opening and will be researching that to correct it.

thanks for your interest and help.
0
 

Author Closing Comment

by:mamuscia
ID: 38360312
After further research it appears as though there are errors in the page being called, so the error was not that javascript had issues opening the window, but in the content of the window being opened.
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
A while back, I ran into a situation where I was trying to use the calculated columns feature in SharePoint 2013 to do some simple math using values in two lists. Between certain data types not being accessible, and also with trying to make a one to…
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
The viewer will learn how to count occurrences of each item in an array.
Suggested Courses

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question