Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Replace dont work within JS/QML
Forum Updated to NodeBB v4.3 + New Features

Replace dont work within JS/QML

Scheduled Pinned Locked Moved QML and Qt Quick
2 Posts 2 Posters 5.0k 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.
  • A Offline
    A Offline
    Alcatraz
    wrote on 14 Jun 2012, 17:56 last edited by
    #1

    within my function i have

    @ var str = url // URL = http://some.website.com
    var n =str.replace("http:///","")@

    dont work even when i try to use escape char

    "http://"

    basically i want to take my url variable and remove the http:// from it this works with js web like (jsbin.com) but will not work on QML i get an error

    TypeError: Result of expression 'str.replace' [undefined] is not a function.

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mbrasser
      wrote on 18 Jun 2012, 01:36 last edited by
      #2

      Hi,

      You should be able to get this working by changing the first line to:

      @var str = url.toString()@

      Regards,
      Michael

      1 Reply Last reply
      0

      1/2

      14 Jun 2012, 17:56

      • Login

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