Results 1 to 2 of 2

Thread: getting javaScript from html

  1. #1
    Join Date
    Aug 2010
    Posts
    4
    Qt products
    Qt4

    Default getting javaScript from html

    Hi,
    I have an html doc in which some javascripts are embedded in it , i want to extract only some part of the script from html , how can i do this?

    Thanks in advance
    Asvindh

  2. #2
    Join Date
    Apr 2010
    Posts
    769
    Thanks
    1
    Thanked 94 Times in 86 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: getting javaScript from html

    Scan the text for opening and closing tags of the form

    Qt Code:
    1. <script type="text/javascript">
    2. ...
    3. </script>
    To copy to clipboard, switch view to plain text mode 

    and extract the scripting code from within them. You'll need to accomodate variants depending on your source, like upper and lower case, variable whitespace and so forth, but this is made easier with regular expression parsers like those provided by Qt.

    There is no "gimmeJavaScript()" function, though. Although there must be something related in WebKit, even if it isn't publicly exposed. WebKit is a problem, however, because it isn't very portable; several systems and compilers are not able to build it.

Similar Threads

  1. Replies: 1
    Last Post: 29th April 2011, 23:50
  2. QtWebKit access HTML manipulated by javascript
    By rbp in forum Qt Programming
    Replies: 1
    Last Post: 19th September 2009, 02:29
  3. add custom HTML attribute by javascript in QtWebKit
    By sand.fj.wen in forum Qt Programming
    Replies: 3
    Last Post: 17th April 2009, 07:25
  4. Javascript
    By ale301168 in forum Qt Programming
    Replies: 0
    Last Post: 6th September 2008, 23:23
  5. JavaScript in QTextBrowser
    By manojmka in forum Qt Programming
    Replies: 4
    Last Post: 27th December 2007, 08:22

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.