Javascript illegal constructor when creating blobs
10 replies, posted
I'm trying to create a Blob in javascript on a html panel with this code:
[CODE]var blob = new Blob(["Test blob"], { type: "text/plain" });[/CODE]
but it errors with [CODE]Uncaught TypeError: Illegal constructor[/CODE]
My first thought is that gmod doesn't support blobs but if I do [CODE]console.log(Blob.toString())[/CODE] it returns [CODE]function Blob() { [native code] }
[/CODE]
So therefore the constructor does exist, but I'm not sure if it's something I'm doing wrong or is this a bug with gmod?
That's illegal, reported this thread to your local police force.
Thanks for the help.... Why should I even bother posting here if I'm going to get foolish responses?
First of all. Wrong forum -_- This forum is for gLua -_-
The forum's description says "Help and discussion on development for Garry's Mod". Nowhere does it say gLua only... And this problem is to do with gmod. It's in the right forum.
typically when somebody gets garrysmod support it's in the language the game was created in
Lua is not the language garrysmod was created in.
Okay. So is Garry's Mod coded in JavaScript??
[QUOTE=VortexZ;47476222]First of all. Wrong forum -_- This forum is for gLua -_-[/QUOTE]
This forum is for [b]any[/b] development for garrysmod (except maps and modeling).
So you can post for help no matter the programming language, as long its aimed at Garrysmod. Even the programming language [url=http://en.wikipedia.org/wiki/LOLCODE]LOLCODE[/url].
[QUOTE=garry;39737459]This forum is for help modding Garry's Mod.
This does NOT include Mapping or Modelling.
Mapping: [url]http://facepunch.com/forums/40[/url]
Modelling: [url]http://facepunch.com/forums/38[/url]
...(Stuff you should have read before posting)[/QUOTE]
[QUOTE=VortexZ;47476358]Okay. So is Garry's Mod coded in JavaScript??[/QUOTE]
Yes, [url=https://github.com/garrynewman/garrysmod/tree/4eb9bb19dcfac06007691376ecaf2dbc56efa6b2/garrysmod/html]partially[/url]
So you are all wrong. Garrysmod's menus are programmed in HTML cause [url=http://garry.tv/2014/08/16/i-fell-out-of-love-with-lua/]Garry likes JS more than LUA[/url].. besides Gmod supports JS-interaction (see [url=http://wiki.garrysmod.com/page/Panel/RunJavascript]Panel:RunJavascript[/url]).
On topic:
Some browsers like mobile-chrome have Blob-construction broken. In this case I'm not sure about Awesomium. You can try an [url=http://stackoverflow.com/questions/15293694/blob-constructor-browser-compatibility]alternative[/url] and test if it throws an error. Not really the best when it comes to JS.
You might find more help under the [url=http://facepunch.com/forumdisplay.php?f=240]Programming Forum[/url] as the major users here only use GLua.
Thanks for a decent reply, I saw the alternative before and it still throws the same error. It seems that for what I'm trying to achieve it's not worth the effort.
[QUOTE]You might find more help under the Programming Forum as the major users here only use GLua.[/QUOTE]
Go to the programming forum instead. I understand now you're doing something with Garry's Mod but you'll get better feedback on the programming forum...
Sorry, you need to Log In to post a reply to this thread.