dbf_usr Posted November 6, 2020 Share Posted November 6, 2020 Как открыть ссылку в новой вкладке браузера? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted November 6, 2020 Share Posted November 6, 2020 2 hours ago, dbf_usr said: Как открыть ссылку в новой вкладке браузера? UniSession.BrowserWindow('http://google.com', 0, 0, '_blank'); Quote Link to comment Share on other sites More sharing options...
dbf_usr Posted November 8, 2020 Author Share Posted November 8, 2020 Спасибо! Quote Link to comment Share on other sites More sharing options...
artem_niko Posted May 5, 2022 Share Posted May 5, 2022 On 11/7/2020 at 2:32 AM, Sherzod said: UniSession.BrowserWindow('http://google.com', 0, 0, '_blank'); Работает, ага. А как сделать, чтобы не в новом окне открывалось, а на новой вкладке в текущем браузере? Какое значение должно быть вместо _blank? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 5, 2022 Share Posted May 5, 2022 3 hours ago, artem_niko said: А как сделать, чтобы не в новом окне открывалось, а на новой вкладке в текущем браузере? Добрый день, Каким образом Вы запускаете код? Quote Link to comment Share on other sites More sharing options...
artem_niko Posted May 5, 2022 Share Posted May 5, 2022 Just now, Sherzod said: Добрый день, Каким образом Вы запускаете код? Путем нажатия на обычный UniImage... Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 5, 2022 Share Posted May 5, 2022 36 minutes ago, artem_niko said: Путем нажатия на обычный UniImage... Вы можете попробовать такой подход: UniImage1.ClientEvents.ExtEvents -> function click(sender, eOpts) { window.open('http://www.google.com', '_blank'); } 1 Quote Link to comment Share on other sites More sharing options...
artem_niko Posted May 5, 2022 Share Posted May 5, 2022 18 minutes ago, Sherzod said: Вы можете попробовать такой подход: UniImage1.ClientEvents.ExtEvents -> function click(sender, eOpts) { window.open('http://www.google.com', '_blank'); } You code is working, but, when I'm clicking on UniImage, my link open in new tab, in my browser and also create and new window not in my browser... Need open only in new tab in browser Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 5, 2022 Share Posted May 5, 2022 2 minutes ago, artem_niko said: also create and new window not in my browser ?? Quote Link to comment Share on other sites More sharing options...
artem_niko Posted May 5, 2022 Share Posted May 5, 2022 3 minutes ago, Sherzod said: ?? В общем, когда нажимаю на UniImage, то моя ссылка открывается в той же вкладке, где открыт проект + создается отдельно тоже окно, в котором открывается также моя ссылка: Мне всего лишь надо, открыть мою ссылку в новой вкладке, одного браузера и перейти на нее. В общем, также, как это работает в демках UniGUI на сайте, при нажатии узла в дереве. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 5, 2022 Share Posted May 5, 2022 7 minutes ago, artem_niko said: and also create and new window not in my browser Похоже у Вас также есть код, который выполняется на серверной стороне. Quote Link to comment Share on other sites More sharing options...
artem_niko Posted May 5, 2022 Share Posted May 5, 2022 1 minute ago, Sherzod said: Похоже у Вас также есть код, который выполняется на серверной стороне. Только это: Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 5, 2022 Share Posted May 5, 2022 Можете на простом тестовом примере проверить? Quote Link to comment Share on other sites More sharing options...
artem_niko Posted May 5, 2022 Share Posted May 5, 2022 1 minute ago, Sherzod said: Можете на простом тестовом примере проверить? А у Вас работает Ваш код? Quote Link to comment Share on other sites More sharing options...
artem_niko Posted May 5, 2022 Share Posted May 5, 2022 3 minutes ago, Sherzod said: Можете на простом тестовом примере проверить? Ой, блин...Я сам косяка дал. Ваш код работает отлично. Создавалось новое окно, т.к. я забыл очистить свойство OnClick у UniImage, поэтому срабатывало 2 кода. Сейчас все отлично! 1 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 5, 2022 Share Posted May 5, 2022 22 minutes ago, artem_niko said: Создавалось новое окно, т.к. я забыл очистить свойство OnClick у UniImage, поэтому срабатывало 2 кода. 34 minutes ago, Sherzod said: Похоже у Вас также есть код, который выполняется на серверной стороне. Да. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.