×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Mar 2008
    Posts
    26

    Question QGraphicWebView: Dynamically loading Javascript from QResource

    I'm using QGraphicWebView to load "index.html" from QResource.
    view->load(QUrl("qrc:/html/index.html"));

    On the index.html I'm loading "myscript1.js"
    <script language="javascript" type="text/javascript" src="qrc:/javascript/myscript1.js"></script>

    On "myscript1.js" I'm dynamically trying to load "myscript2.js" also from QResource. But on this case with no success?


    var url = 'qrc:/javascript/myscript2.js'

    jQuery.ajax(
    {
    async: true,
    cache: true,
    dataType: "script",
    type: "GET",
    url: url,
    error: function(data) {
    console.log('EC.loadERROR:'+url);
    },
    success: function() {
    console.log('EC.loadSUCCESS:'+url);
    },
    complete: function() {
    }
    });

    Printing out window.location I got:
    host = ""
    hostname = ""
    protocol = "qrc:"
    pathname = "/html/index.html"


    Suggestions are welcome!!
    Last edited by romulovitor; 2010-03-10 at 20:46.

  2. #2
    Nokia Developer Moderator
    Join Date
    Oct 2009
    Posts
    4,326

    Re: QGraphicWebView: Dynamically loading Javascript from QResource

    If I run the provided code in Firefox it says jQuery is not defined. I was trying also with WebKit based Epiphany, but didn't find any JavaScript console.

  3. #3
    Registered User
    Join Date
    Mar 2008
    Posts
    26

    Re: QGraphicWebView: Dynamically loading Javascript from QResource

    Quote Originally Posted by divanov View Post
    If I run the provided code in Firefox it says jQuery is not defined. I was trying also with WebKit based Epiphany, but didn't find any JavaScript console.

    I forgot to say that I'm also loading jquery.js on "index.html"
    <script language="javascript" type="text/javascript" src="qrc:/javascript/jquery.js"></script>


    All html and javascript that I using work perfectly on Firefox, IE and Safari. But when putting the code into QResource I'm having no lucky!

    You can try using any examples from Guarana UI (http://wiki.forum.nokia.com/index.ph..._for_Nokia_WRT) where it load all required files using HTTPRequest when invoking Nokia.use().

Similar Threads

  1. Replies: 5
    Last Post: 2010-03-11, 13:04
  2. Replies: 5
    Last Post: 2009-11-17, 16:05
  3. MBM image is not found
    By tamhanna in forum Symbian C++
    Replies: 14
    Last Post: 2009-04-20, 12:44
  4. Theme Studio 3.1 not creating themes
    By zemm in forum Themes/Carbide.ui
    Replies: 11
    Last Post: 2008-10-18, 08:41
  5. Compilation series 60 3rd edition
    By asmobease in forum Symbian C++
    Replies: 3
    Last Post: 2006-09-10, 14:08

Posting Permissions

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