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
LVL 11
Robb HillSenior .Net DeveloperAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

leakim971PluritechnicianCommented:
var ref = window.open("http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Jquery/Q_28229543.html","Q_28229543");

// close it :
ref.close()

// load a new content in the same window : Q_28229543
ref = window.open("http://www.experts-exchange.com/M_3540747.html","Q_28229543");
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Robb HillSenior .Net DeveloperAuthor Commented:
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

0
Robb HillSenior .Net DeveloperAuthor Commented:
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

0
Exploring SharePoint 2016

Explore SharePoint 2016, the web-based, collaborative platform that integrates with Microsoft Office to provide intranets, secure document management, and collaboration so you can develop your online and offline capabilities.

leakim971PluritechnicianCommented:
so close it and reopen a new one
0
Robb HillSenior .Net DeveloperAuthor Commented:
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
0
leakim971PluritechnicianCommented:
use ref.location.href = "the new url";
0
Robb HillSenior .Net DeveloperAuthor Commented:
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.
0
leakim971PluritechnicianCommented:
0
Robb HillSenior .Net DeveloperAuthor Commented:
3rd party solution is not what I need.  that was a suggestion from someone else on EE.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
jQuery

From novice to tech pro — start learning today.