dbf_usr Posted November 6, 2020 Share Posted November 6, 2020 Как открыть ссылку в новой вкладке браузера? 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'); Link to comment Share on other sites More sharing options...
dbf_usr Posted November 8, 2020 Author Share Posted November 8, 2020 Спасибо! 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? 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: А как сделать, чтобы не в новом окне открывалось, а на новой вкладке в текущем браузере? Добрый день, Каким образом Вы запускаете код? 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... 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 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 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 ?? 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 на сайте, при нажатии узла в дереве. 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 Похоже у Вас также есть код, который выполняется на серверной стороне. 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: Похоже у Вас также есть код, который выполняется на серверной стороне. Только это: Link to comment Share on other sites More sharing options...
Sherzod Posted May 5, 2022 Share Posted May 5, 2022 Можете на простом тестовом примере проверить? 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: Можете на простом тестовом примере проверить? А у Вас работает Ваш код? 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 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: Похоже у Вас также есть код, который выполняется на серверной стороне. Да. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now