Results 1 to 10 of 10

Thread: Refreshing after changes to js file

  1. #1
    Senior Member
    Join Date
    Apr 2012
    Location
    Dubai, United Arab Emirates
    Posts
    485

    Refreshing after changes to js file

    I have a page with a section webview
    In the rsp for this I have :

    <script src="./main.js"></script>

    In this I have some code that fires on the click of a button in the webview and it shows a message wait window test1
    This all works fine

    If I got the main.js file and later test1 to test2 and then close and save that and go back to the page the button when clicked displays a wait window test1

    On the page I have right clicked in several places and get the reload message comes up and I click on that to reload it, but no matter what i try it always says test1

    Close Lianaj and go back in and it will say test2

    Is this expected behaviour, or am I just not refreshing the webview properly ?

  2. #2
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,769
    You can't reload a dynamically generated page.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  3. #3
    Senior Member
    Join Date
    Apr 2012
    Location
    Dubai, United Arab Emirates
    Posts
    485
    Hi Barry,

    So I have to come out of Lianja and go back in for changes I make to the JS files to be active in the webview?

  4. #4
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,769
    The WebView acts just like a web browser it caches the JavaScript files. There is a menuitem in the system menu (click the image to the far left of the HeaderBar). In the "File" submenu you will see "Clear cache...", that will clear the WebView cache.
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  5. #5
    Senior Member
    Join Date
    Apr 2012
    Location
    Dubai, United Arab Emirates
    Posts
    485
    Thanks Barry

    I just wanted to check that I wasn't doing something wrong, which is common for me

  6. #6
    Senior Member
    Join Date
    Apr 2012
    Location
    Dubai, United Arab Emirates
    Posts
    485
    Not an issue, but that does not seem to work.

    Do you want me to raise a ticket for it ?

  7. #7
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,769
    Ok try this trick.

    postfix ?v=x.y

    where x.y is the version number and the browser will probably not cache the JavaScript file as it sees arguments to the URL which are different.

    e.g.

    <script src="./main.js?v=1.0"></script>

    and change the version number whenever you edit the code.

    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  8. #8
    Senior Member
    Join Date
    Apr 2012
    Location
    Dubai, United Arab Emirates
    Posts
    485

    [Solved]

    Yes that worked

    Thanks
    Last edited by barrymavin; 2013-09-17 at 03:09.

  9. #9
    Lianja Development Team barrymavin's Avatar
    Join Date
    Feb 2012
    Location
    UK, USA, Thailand
    Posts
    5,769
    Quote Originally Posted by avianmanagement View Post
    Yes that worked

    Thanks
    Web developer tricks
    Principal developer of Lianja, Recital and other products

    Follow me on:

    Twitter: http://twitter.com/lianjaInc
    Facebook: http://www.facebook.com/LianjaInc
    LinkedIn: http://www.linkedin.com/in/barrymavin

  10. #10
    Senior Member
    Join Date
    Apr 2012
    Location
    Dubai, United Arab Emirates
    Posts
    485
    It's all double Dutch to me so it's more like voodo magic

    I have to say the more bits of it I try the more I like the power of JavaScript

Bookmarks

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
  •  
Journey into the Cloud
Join us