3D for mortals Posted June 21, 2018 Share Posted June 21, 2018 for example i have: html button <button id="objButton" onclick="fileExport()"></button> result of var objtext = BABYLON.OBJExport.OBJ(OBJexport); // this is *.obj file syntax with meshes from scene what syntax should i use inside fileExport function, that popup window savefile in browser? I have syntax with link a href which work , but i need use button, because the program gui with buttons usually, but not with text links. this is a href syntax: function download(text, name, type) { var a = document.getElementById("a"); var file = new Blob([text], {type: type}); a.href = URL.createObjectURL(file); a.download = name; } after this, click link and can save file. I need button way. If possible not way where button press call a.click() Quote Link to comment Share on other sites More sharing options...
NasimiAsl Posted June 21, 2018 Share Posted June 21, 2018 a.onclick() or $(a).click() Quote Link to comment Share on other sites More sharing options...
3D for mortals Posted June 21, 2018 Author Share Posted June 21, 2018 20 minutes ago, NasimiAsl said: a.onclick() or $(a).click() omg))) ... button way!... pure button way, because i want that sources will be taken only in time of creating exported file data. In case of use a.onclick , "a" must be prepaired before using, and take cpu and memory every time i recount model. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.