Search found 170 matches

by the.weavster
Thu Jun 03, 2021 6:40 am
Forum: Javascript
Topic: What am I doing wrong when importing a JS script?
Replies: 11
Views: 3486

Re: What am I doing wrong when importing a JS script?

Peter wrote: Wed Jun 02, 2021 8:48 pmHowever, I don't know if there are side effects.
That's why I restored it after the imports complete ... I don't know either :mrgreen:
by the.weavster
Thu May 27, 2021 8:12 pm
Forum: Javascript
Topic: What am I doing wrong when importing a JS script?
Replies: 11
Views: 3486

Re: What am I doing wrong when importing a JS script?

Paul wrote: Thu May 27, 2021 8:02 pm Browser Dev Tools shows
Uncaught SyntaxError: Unexpected token '{' spiderbasic.js:279
That's because the SB IDE has altered the case of the JavaScript code.
You have to go to:
Preferences->Editor->Editing->Enable Case Correction
to stop it doing that (untick the checkbox)
by the.weavster
Thu May 27, 2021 5:08 pm
Forum: Javascript
Topic: Babylon.js : Problem with the latest release
Replies: 29
Views: 6816

Re: Babylon.js : Problem with the latest release

I think you guys may be interested in this, I tried it with Babylon also and it seems to work (I get BABYLON in the global namespace).
by the.weavster
Thu May 27, 2021 4:47 pm
Forum: Javascript
Topic: What am I doing wrong when importing a JS script?
Replies: 11
Views: 3486

Re: What am I doing wrong when importing a JS script?

I have found how to import Metro UI. It's another library that detects define in the global namespace and it's that that interferes with LoadScript() so what I have done is temporarily hidden define until the imports are completed: Global nLoaded Global nImports = 2 Procedure Main() EnableJS var btn...
by the.weavster
Wed May 26, 2021 8:24 pm
Forum: Coding Questions
Topic: Spiderbasic invents query strings...?
Replies: 6
Views: 279

Re: Spiderbasic invents query strings...?

I think you need to include the file extension in the URL. That worked for me with Apache, without the extension I got 404. Protected URL.s = "http://127.0.0.1:8080/cgi-bin/cgiprinter.exe" Sometimes you see a CGI's extension edited to be .cgi in order to keep the client side scripts platfo...
by the.weavster
Wed May 26, 2021 6:55 am
Forum: Coding Questions
Topic: Spiderbasic invents query strings...?
Replies: 6
Views: 279

Re: Spiderbasic invents query strings...?

I doubt it's the query string, I think that just gets assigned to an environment variable that your CGI can access if required.

What do you get from:

Code: Select all

Debug HTTPInfo(HTTPRequest, #PB_Http_ErrorMessage)
by the.weavster
Wed May 26, 2021 6:18 am
Forum: Coding Questions
Topic: Error: multipleDefine
Replies: 12
Views: 902

Re: Error: multipleDefine

By default the SpiderBasic IDE will fix the case of SpiderBasic key words which can cause issues with JS code between EnableJS and DisableJS, as you've found here if gets changed to If.

You can turn off that behaviour in preferences: Editor -> Editing -> Enable Case Correction.
by the.weavster
Tue May 25, 2021 8:41 pm
Forum: Coding Questions
Topic: Error: multipleDefine
Replies: 12
Views: 902

Re: Error: multipleDefine

How about this? Procedure Main() Debug "All good!" ws = #Null EnableJS v_ws = new window.ReconnectingWebSocket(''); DisableJS EndProcedure Global nLoaded Global nImports = 2 Procedure RequireScript(url.s, objName.s) EnableJS require([v_url], function(obj) { window[v_objname] = obj; v_nload...
by the.weavster
Tue May 25, 2021 8:04 pm
Forum: Coding Questions
Topic: Error: multipleDefine
Replies: 12
Views: 902

Re: Error: multipleDefine

(function (global, factory) { if (typeof define === 'function' && define.amd) { define([], factory); // <- this is the branch it takes } else if (typeof module !== 'undefined' && module.exports){ module.exports = factory(); } else { global.ReconnectingWebSocket = factory(); // <- I ...
by the.weavster
Tue May 25, 2021 4:26 pm
Forum: Coding Questions
Topic: Error: multipleDefine
Replies: 12
Views: 902

Re: Error: multipleDefine

It looks like the problem might be that reconnecting-websocket detects that RequireJS has been loaded and so expects you to do something with that ... (function (global, factory) { if (typeof define === 'function' && define.amd) { define([], factory); // <- this is the branch it takes } else...