I have an HTMLviewer in a window displaying one url.
I would like to display another url in the same window, but I’m confused about how to replace the first content with the second.
Any help would be appreciated.
I have an HTMLviewer in a window displaying one url.
I would like to display another url in the same window, but I’m confused about how to replace the first content with the second.
Any help would be appreciated.
What did you do to get it to display the first URL?
Dim aStr As String
aStr = “https://xmldata.qrz.com/xml/current/?s=” + SessionKey + “;html=” + Main.callSign
HTMLViewer1.LoadURL( aStr )
HTMLViewer1.Visible = True
latest effort:
2 HTMLviewers overlain on one another.
BevelButton 1 code
Dim aStr As String
aStr = “https://xmldata.qrz.com/xml/current/?s=” + SessionKey + “;html=” + Main.callSign
HTMLViewer1.LoadURL( aStr )
HTMLViewer1.Visible = True
HTMLViewer2.Visible = False
BevelButton 2 code
Dim aStr As String
HTMLViewer1.Visible = False
aStr = “http://www.levinecentral.com/ham/grid_square.php?Call=” + Main.callSign
HTMLViewer2.Visible = True
HTMLViewer2.LoadURL( aStr )
BevelButton1 always brings HTMLviewer1 up, BevelButton2 produces no result
why not have ONE HtmlViewer and just switch the linked URL instead of attempting to flip two controls?
// BevelButton 1 code
Dim aStr As String
aStr = "https://xmldata.qrz.com/xml/current/?s=" + SessionKey + ";html=" + Main.callSign
HTMLViewer1.LoadURL( aStr )
// BevelButton 2 code
Dim aStr As String
aStr = "http://www.levinecentral.com/ham/grid_square.php?Call=" + Main.callSign
HTMLViewer1.LoadURL( aStr )
Dave…that was my first approach.
Let me try it again.
Okay…tried again.
Copied straight from your post into my project.
Nothing happens when BevelButton2 is pressed. Content from url(1) remains in window.
If you want to try the code with valid variables use
SessionKey = 62ac82df07b4018fcb322e7e95a04b00
Main.callSign = w1kok
Project: testHTMLbuttons
Date: Friday, April 19, 2019 11@17@39 AM
Window1
Class Window1
Inherits Window
Properties
callSign As String = “w1kok” SessionKey As String
Window1 Control BevelButton1:
Sub Action()
Dim aStr As String
aStr = "https://xmldata.qrz.com/xml/current/?s=62ac82df07b4018fcb322e7e95a04b00;html= " + callSign
HTMLViewer1.LoadURL( aStr )
End Sub
Window1 Control BevelButton2:
Sub Action()
Dim aStr As String
aStr = “http://www.levinecentral.com/ham/grid_square.php?Call=” + callSign HTMLViewer1.LoadURL( aStr )
End Sub
Window1 Control HTMLViewer1:
End Class
=============
I must be doing something incredibly stupid. When I change the URLs it works fine.
Project: testHTMLbuttons-1
Date: Friday, April 19, 2019 11A25A29 AM
Window1
Class Window1
Inherits Window
Properties
callSign As String = “w1kok”
SessionKey As String
Window1 Control BevelButton1:
Sub Action()
Dim aStr As String
aStr = “https://www.google.com/advanced_search?hl=en”
HTMLViewer1.LoadURL( aStr )
End Sub
Window1 Control BevelButton2:
Sub Action()
Dim aStr As String
aStr = “https://www.bing.com”
HTMLViewer1.LoadURL( aStr )
End Sub
Window1 Control HTMLViewer1: End Class
Ed, you should really learn how to hit the Code icon above <[>] before you paste code. That would make it a whole lot easier to read.
What about:
[code]Window1 Control BevelButton2:
Sub Action()
Dim aStr As String
aStr = “http://www.levinecentral.com/ham/grid_square.php?Call=” + callSign
HTMLViewer1.LoadURL( aStr )
End Sub
[/code]
IT DOESN"T LIKE HTTP:
it ONLY works with HTTPS:
Mike, I see it now… thanks!
Dave, this still doesn’t produce a page
Dim aStr As String
aStr = "https://www.levinecentral.com/ham/grid_square.php?Call=w1kok"
HTMLViewer1.LoadURL( aStr )
but if I paste the same url into my browser, it does…
is php the problem?
Add an Error event to the HTMLviewer1 and see if it fires on that page. That might give you a clue.
What version of xojo and on what platform?
https://www.levinecentral.com/ham/grid_square.php?Call=w1kok
probably wont work because the site is redirecting from https to http with an invalid certificate, it looks like IIS is mis-configured where as the same URL on http seems to work.
I.e. open chrome in
http://www.levinecentral.com/ham/grid_square.php?Call=w1kok
then change the http to http and see the issue.
Are you using URL Rewrite?
Edward: got this error after specifying https
“An SSL error has occurred and a secure connection to the server cannot be made.”
Julian: 2019 release 1on a Mac OS 10.14.3 and the page works in Safari. Not sure what “URL Rewrite” refers to.
Dave: yes, the problem seems to have to do with the levinecentral url.