Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt WebKit
  4. Jquery in combination with qml webview
Forum Updated to NodeBB v4.3 + New Features

Jquery in combination with qml webview

Scheduled Pinned Locked Moved Qt WebKit
2 Posts 2 Posters 2.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MisjanePane
    wrote on last edited by
    #1

    Hi all,

    I have a very simple qml page:

    @import QtQuick 2.2
    import QtWebKit 3.0

    import QtWebKit.experimental 1.0

    Rectangle {
    id: mes11

    width: 800
    height: 430
    
    x: 0
    y: 50
    
    color: "#565656"
    
    WebView {
        id: mesWebView
    
        width: parent.width
        height: parent.height
    
        anchors.fill: parent
    
        url: "http://10.237.66.106/FlexNet/Kiosk/Login.aspx?BackToStartPage=true"
        experimental.preferences.javascriptEnabled: true
    }
    

    }
    @

    1. The html contains jquery function calls. Basically Ajax calls.
    2. The jquery library is stored on the webserver. Path of the jquery library is included in the html page.

    If I use firefox or chrome and browse to this url the ajax calls are working.
    If I use the qml webview they don't.

    Is this supposed to work with a qm webview (Qt 5.2.1, Webkit 3.0) or what do I need to do additionally?

    1 Reply Last reply
    0
    • B Offline
      B Offline
      brcontainer
      wrote on last edited by
      #2

      Show log in DEBUG mode, enable console in webView desktop (if possible).

      I try compile in my desktop your QML, but not showed... (invisible for me...) i try this:

      @import QtQuick 2.2
      import QtQuick.Controls 1.1
      import QtWebKit 3.0

      import QtWebKit.experimental 1.0

      ApplicationWindow {
      visible: true
      width: 640
      height: 480
      title: qsTr("Hello World")

      menuBar: MenuBar {
          Menu {
              title: qsTr("File")
              MenuItem {
                  text: qsTr("Exit")
                  onTriggered: Qt.quit();
              }
          }
      }
      
      WebView {
          id: mesWebView
      
          width: parent.width
          height: parent.height
      
          anchors.fill: parent
      
          url: "http://www.jquery4u.com/demos/ajax/"
          experimental.preferences.javascriptEnabled: true
      }
      

      }
      @

      Work fine for me...

      So the problem must be in YOUR JAVASCRIPT (and not Jquery) that is a fault with that usually when we do not use "use strict;" the problem does not occur in some webbrowsers, but can occur in others.

      Try using the "use strict;" and test your page in "google chorme" in "firefox". (READ ABOUT in https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode)

      You will probably see some normal mistakes WE usually do in javascript.

      Good luck!

      QT project: https://github.com/brcontainer/qt-helper

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved