×

Discussion Board

Results 1 to 13 of 13

Hybrid View

  1. #1
    Registered User
    Join Date
    Feb 2012
    Posts
    14

    mwl undefined in some files, but not others

    I'm having a problem getting MWL to work - in some files in my project, it works just fine, but in others it doesn't. This happens even if the code is identical - I can copy and paste the entire contents of one file into another, and it will work in the first but not the second. When I check the type of MWL ( using alert( typeof mwl ); or alert( typeof window.mwl); ), it comes up as undefined in some files and as object in others - again, even if the code in the 2 files is identical.

    I can't find any project settings or anything else that would cause this, and it only seems to be happening in certain files - in others, MWL is defined and the functions work just fine.

    Any help with this would be greatly appreciated.
    Thanks.

  2. #2
    Nokia Developer Expert
    Join Date
    Jun 2008
    Location
    Tampere
    Posts
    833

    Re: mwl undefined in some files, but not others

    Hi and welcome to forum!

    Could you describe, those situations where you encounter this problem, in more detail?
    Is it just simulator (local / cloud preview) or after deploying to device?

    Br,
    Ilkka

  3. #3
    Registered User
    Join Date
    Feb 2012
    Posts
    14

    Re: mwl undefined in some files, but not others

    It's in the both the local and cloud preview simulators. Additionally, I discovered after posting that it seems to be only when there is something in the query string - when I have something in the query string, the <body> section of the page (or maybe the entire page, tough to tell) seems to load twice; the first time MWL seems to load properly, but the second it doesn't. With no query string, everything seems to load normally. I've confirmed that it's none of my scripts doing this, as it still happens when the scripts are removed entirely.
    I'm testing this by putting the following at the start of the <body> section:

    <script language="javascript" type="text/javascript">
    alert( typeof mwl );
    </script>

    When there is no query string, the alert box pops up once, with the text 'object' (as expected). With a query string, it appears twice, once with 'object', and then again with 'undefined'.

  4. #4
    Registered User
    Join Date
    Feb 2012
    Posts
    14

    Re: mwl undefined in some files, but not others

    Also, this only seems to happen the first time - everything works fine until the first time you call a page with a query string, but after that, the pages only load once and MWL is always undefined whether there is a query string or not, until restarting the app.

  5. #5
    Nokia Developer Expert
    Join Date
    Jun 2008
    Location
    Tampere
    Posts
    833

    Re: mwl undefined in some files, but not others

    Thanks for the clarification, but now I'm even more confused

    Are you having multiple pages, and for example, link to those pages using query strings to pass data, or what is the use case for query strings?

    Br,
    Ilkka

  6. #6
    Registered User
    Join Date
    Feb 2012
    Posts
    14

    Re: mwl undefined in some files, but not others

    Yeah, multiple pages. So, for example, index.html will have a link, testpage.html?test=1, and clicking on that link will cause the problems. Simply loading testpage.html without a query string works fine.
    In this specific case I'm using the query strings to pass information categories between pages.

Similar Threads

  1. undefined symbol
    By koraykayir in forum Symbian
    Replies: 8
    Last Post: 2010-12-07, 14:55
  2. Help with some undefined symbols
    By farmdve in forum Open C/C++
    Replies: 4
    Last Post: 2010-12-03, 07:15
  3. WRT GPS undefined
    By gurmukh in forum Symbian
    Replies: 5
    Last Post: 2010-03-15, 10:44
  4. Undefined identifier
    By ab in forum Symbian
    Replies: 22
    Last Post: 2007-11-27, 11:07
  5. Storing Audio/ image files as byte arrays in flat files(eg. bin files)
    By anantharaj1999 in forum Mobile Java General
    Replies: 0
    Last Post: 2003-06-09, 11:57

Posting Permissions

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