Link to home
Start Free TrialLog in
Avatar of Robb Hill
Robb HillFlag for United States of America

asked on

URL with Parameters refresh

I open an external url with parameters from within a mvc3 web application.  Once I open the url I have two windows open.  If I click within the main application I would like two things to happen.  Close the new window that was open...or refresh it with new parameters based on what was clicked from the primary .net app.  Currently it is just a "dead window" at this point...i would like it to stay interactive with the primary window.  Meaning the ability I guess to keep it open, or refresh with new params.  I am not using frames..this is html5.


Thanks in advance
ASKER CERTIFIED SOLUTION
Avatar of leakim971
leakim971
Flag of Guadeloupe image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Robb Hill

ASKER

its not working.....in my code  a string gets created...and executed in javascript.  but isnt changing the already open windows.  Here is the code segment.


var urlString = $("#HelpContextRedirectLink").attr('data-help-context-route'); //get URL

    $("#HelpContextLink").live('click', function (e) {
        e.preventDefault();       
       
       
        {
                 window.open(urlString , 'WindowName','width=1000, height=700, left=24, top=24, resizable, scrollbars=yes').focus();
        }
    });

Open in new window

something like this code I found...but using jquery..and I do not have any of the buttons.  Would prefer to stick with the .live('click', function....approach.



(function() {
  var childWindow;

  document.getElementById('btnOpen').onclick = openChildWindow;
  document.getElementById('btnClose').onclick = closeChildWindow;
  document.getElementById('btnRefresh').onclick = refreshChildWindow;

  function openChildWindow() {
    if (childWindow) {
      alert("We already have one open.");
    }
    else {
      childWindow = window.open('http://jsbin.com/awiri4');
    }
  }

  function closeChildWindow() {
    if (!childWindow) {
      alert("There is no child window open.");
    }
    else {
      childWindow.close();
      childWindow = undefined;
    }
  }

  function refreshChildWindow() {
    if (!childWindow) {
      alert("There is no child window open.");
    }
    else {
      childWindow.location.reload();
    }
  }
})();

Open in new window

so close it and reopen a new one
Well it works like that now..if I close it...and reopen manually its fine..if I reclick the help button...it will reload the page.  

I need the parent and child windows to continually refresh......perhaps like ping of each other....not sure how to implement this idea
use ref.location.href = "the new url";
thats not working...thats just opening a new window.


Please refer to the question.

I need this parent and child window to talk to each other.  There is no static url to redirect to.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
3rd party solution is not what I need.  that was a suggestion from someone else on EE.