Discussion Board

Results 1 to 3 of 3
  1. #1
    Regular Contributor
    Join Date
    Apr 2005

    Handling & in QWebview page source

    I am using a QWebview to display web pages. The initial page loads and is displayed successfully. However, when a certain link on the page is clicked, the new page fails to load and the webview displays "This page contains the following errors. error on line 13 at column 53: expected '#' or '[a-zA-z]' but got '&'.

    So I examined the html source that it was trying to load, this is line 13:
      <script type="text/javascript">window.Bootloader && Bootloader.done(["6toYh","+sH1I","8E\/OP"]);</script>
    As the error states, there is an & on line 13, column 53.

    I don't own the html source, I am just displaying it in a webview (So i cannot modify the html).

    The interesting part is that the QWebview will display the new webpage on the Qt Simulator, the error only appears on an N8 device (not tested other devices).

    If I set
    ui->webView->settings()->setAttribute(QWebSettings::JavascriptEnabled, FALSE);
    I can reproduce the error on the simulator.

    However, setting this value to TRUE, does not fix the error on the device.

    Have I missed some setting somewhere? Or Is there some clever way of handling this situation?

    I'm using Qt 4.7.3

  2. #2
    Registered User
    Join Date
    Feb 2011

    Re: Handling & in QWebview page source

    I have exactly the same problem.

  3. #3
    Super Contributor
    Join Date
    Oct 2007
    જુનાગઢ - India

    Re: Handling & in QWebview page source

    Probably QWebView fails to load content that have "&" in it. Try to replace "&" with "&amp;" and check what happens.

Similar Threads

  1. issue with QWebView handling redirects
    By GuusDavidson in forum Qt
    Replies: 6
    Last Post: 2011-05-26, 06:52
  2. Replies: 3
    Last Post: 2010-07-13, 17:10

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts