Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Javascript issues

  1. #1
    Member
    Join Date
    May 2010
    Location
    Brisbane, Australia
    Posts
    55

    Default Javascript issues

    Hi Everyone.
    I tried a support ticket for this problem, but have had no response in over a week. Also tried emailing Steve Raubenstine directly, but also no response. Seems we are on our own with NOF now..

    Anyway, my problem is:

    I'm having problems making my Javascript scripted actions work on all platforms. Specifically some Mac platforms. A test computer that I have part-time access to is a 2011 Macbook Pro, running 'macOS High Sierra 10.13.3' It has a problem in both Safari and Chrome.

    The problem appears to be restricted to scripted actions that I create using actions like 'On page loaded' or 'On clicked' in the NOF editor. Actions that I code directly into the HTML, such as by adding tag 'onclick="process_click()"' into the FormsRadioButton HTML work just fine, but if I use an 'On clicked' action through NOF the whole button group stops working completely - as in clicking on a button doesn't even select it, let alone run the associated script.

    If you look at this test site: http://www.brishost.com.au/testsite2 you will see it all works fine in a Windows or Android browser. The line 'Javascript is enabled' is written using an inline script in the layout HTML. The First edit field box is filled with 'Javascript is WORKING fine!' in an 'On page loaded' action script. In the radio button section, Option 1 and Option 2 are a group, and have inline scripts that fill in the associated 'Selected:' edit field box. Option 3 and Option 4 have NOF 'On clicked' actions to fill in their edit field box. All works fine on Windows or Android.

    But on the Macbook, I get 'Javascript is enabled' but 'Javascript is NOT WORKING very well at all.' in the edit box (that's the HTML initialized value). The radio buttons for Option 1 and Option 2 still work perfectly and fill in their 'Selected:' edit box, but The Option 3 and Option 4 buttons do nothing and the Option 4 button can't even be selected. So the 'On page loaded' script is doing nothing, and the 'On clicked' scripts have managed to break even basic button group functionality!

    Interestingly, if I tell Safari on the Macbook to report its user agent as 'Firefox on Windows', everything works fine again.

    The Javascript console on Safari shows up an error: "TypeError: document.all.tags is not a function. (in 'document.all.tags("A")', 'document.all.tags' is undefined)". I don't get this error with the user agent spoofed.

    On an older Macbook, running Snow Leopard, Safari works with the NOF generated Javascript. But Chrome (which is updated to the current version) on the same Macbook fails in the same way as on the newer Macbook. So it seems there has been an update that has made the 'Mac specific' NOF-generated Javascript incompatible with newer Mac's.

    It seems to me that the problem is in how the NOF script wrapper is modifying its actions based on the user agent reported. The above error seems to be in file script.js, which is very hard to read because it's compressed!

    I then asked if there was a new, more compatible version of script.js they could send me, but as I said I got no response.

    Has anyone solved this compatibility problem with newer Mac's? Can you send me an updated script.js to fix it?

    Thanks,
    Adrian.

  2. #2
    Senior Member gprit's Avatar
    Join Date
    Dec 2010
    Location
    South Wales, UK
    Posts
    554

    Default

    You won't get a response from 'support'....
    Not knowing how Macbooks work I cannot help I am afraid - as it is a Javascript issue perhaps one of their forums might help?

  3. #3

    Default

    The problems you are having result from the way NOF tries to make software (NOF) into a web application software which it really isn't. All the radio button, check boxes, text boxes are all web applications that require a scripting language on a server like ASP, Asp.net, Java, PHP, etc. NOF tries to generate scripts that app generators produce but it doesn't do it very well. So relying on Javascript to mimic a web app isn't reliable at all. I doubt NOF was ever tested for Mac computer compatibility in any way. HTML is a standard and it should work on any platform. But with scripting, stuff is not uniform especially when you get off server scripting support to browser scripting support which is OS dependent how it is implemented. Always keep in mind that NOF was made to be used on Windows not Mac parallels or Wine on Linux. Running scripts on a Mac is probably never going to be reliable when they were designed to be run on Windows.

    Java was a very good programming language but Oracle has not paid a lot of attention to it since they got it from Sun. Most programmers now consider Java to be a security risk making it difficult to even run Java sometimes. If you want to write web applications, you should get real web app programming software. NOF is not it. Nof is good at making static web sites.
    Last edited by richs; 03-14-2018 at 01:37 PM.

  4. #4
    Member
    Join Date
    May 2010
    Location
    Brisbane, Australia
    Posts
    55

    Default

    Hi richs.
    Note that I am not using Java, and do not require it to be installed. Apple completely disabled Java several years ago anyway. What I'm talking about is Javascript, browser-based. I.e. Jquery etc. "<script type='text/javascript'>" etc. Used on almost any web site you care to look at these days! And appears to be becoming much more standardized recently, which might be why old 'browser specific' modifications no longer work.
    Also, re your comment: "Always keep in mind that NOF was made to be used on Windows not Mac parallels or Wine on Linux." That's really irrelevant here isn't it? I'm talking about the website it builds, not the building application, and the site should be viewable on any platform.
    Cheers..

  5. #5
    Senior Member gprit's Avatar
    Join Date
    Dec 2010
    Location
    South Wales, UK
    Posts
    554

    Default

    I use this for some galleries and also for example to add a snow effect on a webpage (see below).
    http://www.theruperraarms.co.uk
    (This will be removed shortly as Spring is arriving...)


    <script type="text/javascript" src="./index_nof.js">
    </script>
    </head>
    <body style="background-color: rgb(0,0,0); background-image: none;" class="nof-centerBody">
    <div class="nof-centerContent"><script src="snowstorm.js"></script>
    <script>
    snowStorm.flakesMaxActive = 200 // show more snow on screen at once
    snowStorm.snowStick = true; // stick to bottom of window
    snowStorm.animationInterval = 30; // Speed
    snowStorm.followMouse = false;
    snowstorm.flakeWidth = 50
    snowstorm.flakeHeight = 50
    snowStorm.snowCharacter = '*';
    </script>

  6. #6
    Member
    Join Date
    May 2010
    Location
    Brisbane, Australia
    Posts
    55

    Default

    Hi gprit. Yes, that's Javascript... How does your response relate to the problem of NOF-generated Javascript no longer being compatible with browsers running on Mac OS?

  7. #7
    Senior Member gprit's Avatar
    Join Date
    Dec 2010
    Location
    South Wales, UK
    Posts
    554

    Default

    Quote Originally Posted by adrianjball View Post
    What I'm talking about is Javascript, browser-based. I.e. Jquery etc. "<script type='text/javascript'>" etc.
    Well I assumed (wrongly it seems) that you were having problems inserting javascript, when viewing on Mac OS.
    All I was saying is that I inserted the javascript code and do not have any issues.

    I have previously used NOF generated JS for tick boxes without issues, but not for radio buttons.

    As it seems using the latest Chrome version has caused the problem perhaps the query shoud be addressed on a Chrome forum.
    Maybe they can see what in script.js is causing a conflict with the latest Chrome browser.

    Nothing is going to get updated from a NOF point.

  8. #8
    Member
    Join Date
    May 2010
    Location
    Brisbane, Australia
    Posts
    55

    Default

    Nah, it's not a Chrome problem. The current Safari fails as well. You have to go back to an older version of Safari to have the NOF-generated scripts actually work. The version that comes with Snow Leopard works because it's old - Safari only gets updated with the OS version.

    And as I said, if I tell new Safari to tell the website it's actually Mozilla on Windows (change the user agent string), the Javascript that the website runs then works fine. So it's the script modifications that NOF is doing in script.js if it believes the browser is a Mac, that is causing it to break. I have nailed that down some time ago - I was hoping someone may have fixed script.js by now so it doesn't cause issues.

    I develop on Windows and don't actually own a Mac, so it's hard to test on a variety of platforms. And of course all my active forms and heaps of other Javascript works just fine when the site is viewed on a PC! But unfortunately site users use a whole range of devices, new and old, PC, Mac, phone or tablet. And they all expect the website to work on their device.

  9. #9
    Member
    Join Date
    May 2010
    Location
    Brisbane, Australia
    Posts
    55

    Default

    Ok, on the assumption that nobody else has needed their scripts working cross-platform, I got into script.js, detangled some of the compression, and made a change. I changed:

    var F_MAC=navigator.appVersion.indexOf("Macintosh")>-1;

    to

    var F_MAC=false;

    So that the browser is never detected as being on a Mac, and the stuff in script.js that runs specifically for Mac's no longer runs.
    And now the scripts on my sites work fine on the newer (High Sierra) Mac under both Safari and Chrome. Interestingly on the older (Snow Leopard) Mac the site still works fine under the old Safari. So whatever script.js was doing specific for Mac's isn't needed even for Snow Leopard Mac's. I'm betting I will have broken it for really old, old Mac's, but I have no way to test that and anyway if a user complains that their 15yo Mac doesn't run the site anymore it's easy to tell them that their computer is too old. Telling someone that the site doesn't work because their computer is too new really doesn't sit well!

    If anyone is interested in having their sites work cross-platform, I have attached the modified script.js file here. Copy it into C:\Program Files (x86)\NetObjects\NetObjects Fusion 2015\NetObjects System and next time you publish your site it should get updated.
    Attached Files Attached Files

  10. #10
    Senior Member franko's Avatar
    Join Date
    Apr 2010
    Location
    Tasmania Australia
    Posts
    2,549

    Default

    Adrian, good catch and thanks for the script modification. I've never noticed, not had anyone complain, of this problem, but I'll copy the script in anyway.

Posting Permissions

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