Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to check if javascript element id exist?
Qt 6.11 is out! See what's new in the release blog

How to check if javascript element id exist?

Scheduled Pinned Locked Moved Solved General and Desktop
1 Posts 1 Posters 498 Views
  • 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.
  • N Offline
    N Offline
    nicholaslee
    wrote on last edited by
    #1
    if (ui->webView->page()->mainFrame()->evaluateJavaScript(QString("document.getElementById('ContentPlaceHolder1_ErrorTextLabel').value"))!=null)
            {
    }
    

    I want to make a function that does commands whenever the user makes an invalid log in. So I made a getElementById such that whenever the error text label exist, i can carry out other commands but qt is giving me the error ['null' was not declared in this scope]
    Is it a syntax or declaration error?
    Anyone can help me with this? Thanks!

    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