I run a WordPress website that often has posts with some JavaScript, usually for various calculators. For example, I might use JavaScript to allow a visitor to convert inches to mm. That's a basic example; I have more complicated scripts that need to run.
This JavaScript approach does work for me. However, the problem is I'm not very good at JavaScript, nor have much experience with JavaScript IDEs.
But I do happen to have a lot of experience with VB and Visual Studio. I have ongoing projects with these and would greatly benefit if I could leverage this instead of spreading myself thinner.
So I'm wondering if anyone might know how I could use VB for my calculators on my WordPress website?
As I understand it, the problem is that VB doesn't run on an Apache Server. So I could put the calculators on a sub-domain on a different server. But I actually want the calculators directly within WordPress posts. Perhaps iframes
is an option? Are there any other options I could consider?
I would appreciate any suggestions and info!
Thanks!
Sam
I run a WordPress website that often has posts with some JavaScript, usually for various calculators. For example, I might use JavaScript to allow a visitor to convert inches to mm. That's a basic example; I have more complicated scripts that need to run.
This JavaScript approach does work for me. However, the problem is I'm not very good at JavaScript, nor have much experience with JavaScript IDEs.
But I do happen to have a lot of experience with VB and Visual Studio. I have ongoing projects with these and would greatly benefit if I could leverage this instead of spreading myself thinner.
So I'm wondering if anyone might know how I could use VB for my calculators on my WordPress website?
As I understand it, the problem is that VB doesn't run on an Apache Server. So I could put the calculators on a sub-domain on a different server. But I actually want the calculators directly within WordPress posts. Perhaps iframes
is an option? Are there any other options I could consider?
I would appreciate any suggestions and info!
Thanks!
Sam
Share Improve this question edited Jan 22, 2019 at 21:02 Kashif Rafique 2351 gold badge3 silver badges12 bronze badges asked Jan 22, 2019 at 15:03 MrSamuelMrSamuel 131 silver badge4 bronze badges 01 Answer
Reset to default 3So I'm wondering if anyone might know how I could use VB for my calculators on my Wordpress website.
Directly? No, you can't run .Net in a browser, and the closest available is silverlight and activeX, both of which were discontinued.
As I understand it, the problem is that VB doesn't run on an Apache server. So I could put the calculators on a subdomain on a different server. But I actually want the calculators directly within Wordpress posts. Perhaps I-frames is an option? Are there any other options I could consider?
You'd need a Windows server to host the .Net code, but yes you could have a .Net frontend wrapped in an iframe, be it via a shortcode or OEmbed. But to be honest learning basic javascript sounds like a lot less effort.
How you would setup a .Net server for that though, is beyond the scope of this stack, as are generic javascript questions ( perhaps stackoverflow? )
JS has more in common with PHP than VB.Net does, and you needn't opt for the ES2016/React/Vue/etc, if all your doing is calculations then jQuery or raw JS will do the trick. As for IDE's, you don't need a JS specific IDE like you do with .Net, most popular code editors have JS tooling packages, be it Sublime Text, Coda, Atom, VS Code, etc. Language specific code editors are the exception these days, not the norm
I would also note that it might be tempting to directly embed codes for execution inside of post content. If this works it's because you're an admin and have the unfiltered_html
capability, don't directly embed JS into a posts content, instead use OEmbed, or shortcodes instead as WP will try to strip out JS tags etc for security reasons