Switching tabs JavaScript -


So it's hard to explain, but I will do my best I have added event listeners to my webpage, Will bring some pages with the key press and they will work just fine. I used this code:

  if (e.keycode === 65) window.location.replace ('http://exampleurl.com/example');   

And it works just fine. I tried to open them with new tabs like this:

  if (e.keycode === 65) window.open ('http://exampleurl.com/example', ' _newtab ');   

And this is also perfectly fine now I feel that whenever you try to see any of the pages, it will definitely be annoying to open a new tab. I would like to make it where you have a tab already open in a tab, press the key to go to that page, just go to the tab where it will open. The closest I was able to do this was:

  if (e.keycode === 65) window.open ('http://exampleurl.com/example', '_newtab_home'); If (e.keycode === 66) window.open ('http://anotherexampleurl.com/example2', '_newtab_home');   

And it will open a new URL in the same tab, even if you are in another tab but it will not go to that tab. I think it works because when I say "_newtab_home" it basically names that tab and with that goal everything will open in a tab that is quiet, and I understand it, but when Also the new URL is loaded, how can I open it? I want to be able to open a new tab for those places that have not been visited, but when you go to them and try going back to the homepage (""), then I want to switch it back to the tab I know it was already open in. I know that there is a way to switch the JavaScript tab using tabs numbers:

  var tabnum = 2; $ ('Ul.quicktabs_tabs li.tab' + tabin + 'A'). Triggers ('keys');   

But I would like to do this without tab numbers because the number will always be different because depending on the order the user clicks on them or if they have any tab open. I do not really know how I will do this though.

I think you can go to my site with a major press at around six different places. I want to open my open tab in every location and I want to switch back to that tab whenever you press the key which opens it again, is it possible in javascript? If so, please help me! Thanks in advance. (I am very sorry that if this question is unclear, feel free to comment and ask questions about it.)

There is no way to check whether the window has already opened, but it is a way to check whether the window opening tab is already archiving the references opened from the tab: / P>

HTML:

  & lt; Input type = 'button' id = 'button' value = 'open' & gt;   

JS:

  window.onload = function () {function launchApplication (l_url, l_windowName) {if (typeof launchApplication.winrefs == 'undefined' } {LaunchApplication.winrefs = {}; } If (Type of Launch Apiclity.windows [l_windowName] == 'undefined' || Launch applications.Werfars [L_Windom] is closed) {Launch applications.Venture [L_Windonam] = Window.Open (L_URL, L_Windonam); } Else {launchApplication.winrefs [l_windowName] Focus ()}} document.getElementById ('Button'). AddEventListener ('click', function () {launchApplication ('http://www.google.com', 'g')}); }   

Object:

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -