Android Question WebView Question

Discussion in 'Android Questions' started by tdocs2, Apr 8, 2015.

  1. tdocs2

    tdocs2 Well-Known Member Licensed User

    Greetings, all.

    Thank you for answering my question.

    Obviously, I am missing a basic format building block.

    How do I load the following into a Webview?

    Code:
    <iframe src="https://www.google.com/calendar/embed?height=600&amp;wkst=1&amp;bgcolor=%23FFFFFF&amp;src=f4knsvmphom59qn5tbuehdjbqo%40group.calendar.google.com&amp;color=%23853104&amp;ctz=America%2FNew_York" style=" border-width:0 " width="800" height="600" frameborder="0" scrolling="no"></iframe>
    Webview1.LoadHTML results in this error:

    Code:
    Error description: Undeclared variable 'iframe' is used before it was assigned any value.
    Occurred on line: 53
    WebView1.LoadHtml(<iframe src=
    "https://www.google.com/calendar/embed?height=600&amp;wkst=1&amp;bgcolor=%23FFFFFF&amp;src=i93gh9idpr1b8euk0a01n7g8fk%40group.calendar.google.com&amp;color=%232952A3&amp;ctz=America%2FNew_York" style=" border-width:0 " width="800" height="600" frameborder="0" scrolling="no"></iframe>)
    Thank you.

    Sandy
     
  2. DonManfred

    DonManfred Expert Licensed User

    try
    Code:
    WebView1.LoadHtml("<iframe src='https://www.google.com/calendar/embed?height=600&amp;wkst=1&amp;bgcolor=%23FFFFFF&amp;src=i93gh9idpr1b8euk0a01n7g8fk%40group.calendar.google.com&amp;color=%232952A3&amp;ctz=America%2FNew_York' style=' border-width:0 ' width='800' height='600' frameborder='0' scrolling='no'></iframe>")
    But most probably it is better to NOT use iframes!! IFRAME are deprecated (no go) since 15 years ago or so..
     
    tdocs2 likes this.
  3. tdocs2

    tdocs2 Well-Known Member Licensed User

    Thank you, Don.

    It works! You are clever and quick indeed.

    What replaces the iframe?

    Best regards.

    Sandy
     
  4. NJDude

    NJDude Expert Licensed User

    That's not correct, IFRAMEs are not deprecated, you might be mistaking them with FRAMES.
     
    tdocs2, DonManfred and walterf25 like this.
  5. DonManfred

    DonManfred Expert Licensed User

    You are right... ;-)
     
  6. DonManfred

    DonManfred Expert Licensed User

    It was nothing clever...

    Code:
    WebView1.LoadHtml(<iframe src="https://www.google.com/calendar/embed?height=600&amp;wkst=1&amp;bgcolor=%23FFFFFF&amp;src=i93gh9idpr1b8euk0a01n7g8fk%40group.calendar.google.com&amp;color=%232952A3&amp;ctz=America%2FNew_York" style=" border-width:0 " width="800" height="600" frameborder="0" scrolling="no"></iframe>)
    LoadHTML needs a STRING a Parameter... Are you giving a STRING there???
     
  7. tdocs2

    tdocs2 Well-Known Member Licensed User

    I tried even [QUOTES] but I was missing the fact of the "" embedded in the string.

    I stay with the clever remark. My thanks to NJDude also.

    Sandy
     
    DonManfred likes this.
  8. NJDude

    NJDude Expert Licensed User

    You don't have to write a whole long string to be used with .LoadHTML, I would rather create a small HTML and add it to my assets, in this case, you could save that line in a file called "calendar.html", then to use it, just do something like this:
    Code:
    Private myHTML As String

    myHTML = 
    File.ReadString(File.DirAssets, "calendar.html")

    WebView1.LoadHtml(MyHTML)
    That way you don't have to worry about quotes and stuff like that.
     
    tdocs2 and DonManfred like this.
  9. tdocs2

    tdocs2 Well-Known Member Licensed User

    Thank you, NJ.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice