Page 1 of 1
Webgadget hyperlinks problems..
Posted: Sun Jan 25, 2015 1:48 pm
by AlanFoo
Hi hope someone can help me on this.
I use webgadget for an app that browses the website with hyperlinks.
I notice that if the hyperlink is to create a separate window e.g. using "<a target="_blank" href="
http://yahoo.com" </a>
it would not work. But if I take out "target="_blank" it works.
Is there anyway to overcome this as sometimes we need to open a new window?
Thanks for your help.
Regards
Alan
Re: Webgadget hyperlinks problems..
Posted: Sun Jan 25, 2015 2:18 pm
by RASHAD
Hi
Code: Select all
Text$ = "<a href=http://yahoo.com target=_blank >New Browser</a>"
OpenWindow(0, 0, 0, 400,300, "", #PB_Window_ScreenCentered | #PB_Window_SystemMenu)
WebGadget(0, 10, 10, 300, 65, "")
SetGadgetItemText(0, #PB_Web_HtmlCode, Text$)
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Break
EndSelect
ForEver
Re: Webgadget hyperlinks problems..
Posted: Sun Jan 25, 2015 2:42 pm
by AlanFoo
RASHAD wrote:Hi
Code: Select all
Text$ = "<a href=http://yahoo.com target=_blank >New Browser</a>"
OpenWindow(0, 0, 0, 400,300, "", #PB_Window_ScreenCentered | #PB_Window_SystemMenu)
WebGadget(0, 10, 10, 300, 65, "")
SetGadgetItemText(0, #PB_Web_HtmlCode, Text$)
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Break
EndSelect
ForEver
Hi,
Thanks for your response.
I tried your codes above and ran it.
It show a hyperlink with word "New Browser" .
I clicked it ... nothing happens.
However if i removed that
target=_blank
I loads the yahoo page in the small window.
I would not mind if it just loads without having a new window . it seems nothing happens.
Is yours working? What version of Purebasic are you using. Am still using the old 4.6 version when I bought it.
Have not upgraded yet. :>)
Regards
Alan
Re: Webgadget hyperlinks problems..
Posted: Sun Jan 25, 2015 2:54 pm
by RASHAD
Here is a version with many Hyper Links
PB v5.31 x86 - Win 8.1 x64
Code: Select all
Text$ = "<a href=http://google.com target=_blank > Google </a>" +"<br>"
Text$ = Text$ + "<a href=http://Yahoo.com target=_blank > Yahoo</a>" +"<br>"
Text$ = Text$ + "<a href=http://www.purebasic.com target=_blank > PureBasic </a>"
OpenWindow(0, 0, 0, 400,300, "", #PB_Window_ScreenCentered | #PB_Window_SystemMenu)
WebGadget(0, 10, 10, 380, 280, "")
SetGadgetItemText(0, #PB_Web_HtmlCode, Text$)
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Break
EndSelect
ForEver
Re: Webgadget hyperlinks problems..
Posted: Sun Jan 25, 2015 3:13 pm
by oldBear
Tested both with PB 4.61
Each opens hyperlinks in a new default browser window.
Re: Webgadget hyperlinks problems..
Posted: Sun Jan 25, 2015 4:05 pm
by AlanFoo
Hi,
Thanks for response.
I have found the fault.
After testing it the 5.3 and then on the 4.61 , I discovered that the fault lies with the IE that I am having with my development computer.
When PB opens a new window with a windows browser , it chooses the IE to display the new window not the default browser which my case is Firefox.
There is a problem with my IE ...it seems to be unable to load the html and perpectually loading without displaying a web page . So when PB loads the IE to display the page , my computer did not respond.
Dont know what to do with the IE as I do not wish to touch it , less I get my development computer into trouble.
Any idea what causes the IE to perpectually loading ..... without displaying the page.
Seldom use IE anyway.
Is there anyway to change the default windows browser to be used to be others other than IE since I believe Webgadget is using IE's engine.? Can it be changed to use Firefox;s engine when compiling so that others using the software will also use Firefox or others?
Thanks greatly for your time.
Regards
Alan