How can I preview JS? - Post ID 218090

User 187934 Photo


Senior Advisor
20,265 posts
Online Now

I'm not following you. I'll need some more info.
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com
User 271657 Photo


Ambassador
3,816 posts

I want to push further into java just for kicks,.......

Java or Javascript... 2 different things.
Also...
Containter or Container?
I love deadlines. I like the whooshing sound they make as they fly by. (Douglas Adams)
https://www.callendales.com
User 122279 Photo


Senior Advisor
14,610 posts
Online Now

Eric Rohloff wrote:
Why make it so difficult.;)
<script>
alert('Hello, World!')
</script>

Or, if you don't want a pop-up, which is blocked by a lot of browsers anyway:
<script>
document.write('Hello, World!')
</script>
Ha en riktig god dag!
Inger, Norway

My work in progress:
Components for Site Designer and the HTML Editor: https://mock-up.coffeecup.com


User 2924428 Photo


Registered User
1,718 posts

Sorry I meant javascript, I'm just trying to be able to preview code like before I actually publish it to the internet.
User 2924428 Photo


Registered User
1,718 posts

If you were to build a code that actually did say "hello world" really fast and wanted to preview it in your browser at work lets say and you could just click "live preview" and it would show up in your browser as if you had published it, without publishing it.
User 1948478 Photo


Senior Advisor
1,850 posts

http://www.w3schools.com/js/tryit.asp?f … yjs_events

EDIT: Or just use the CC HTML Editor. You can preview everything there...
User 122279 Photo


Senior Advisor
14,610 posts
Online Now

Exactly what I wanted to say too. Js is client based, not like php which is server based, and you can bang the js onto a website and preview it locally.
Ha en riktig god dag!
Inger, Norway

My work in progress:
Components for Site Designer and the HTML Editor: https://mock-up.coffeecup.com


User 2924428 Photo


Registered User
1,718 posts

Ok then I need to get a new browser :).. i'm linking my sources correctly as far as I know, and have just one string which is hello world, and when I go to preview it in CC Html or anything else I get a grey screen. Google Chrome must not support pop up javascript then?
User 1948478 Photo


Senior Advisor
1,850 posts

The problem is not the browser, nor is it the HTML Editor!

(Study, Think, Experiment; - Rinse and repeat!!)
User 271657 Photo


Ambassador
3,816 posts

This line:
ContainterName.FunctionName(a,b,c,d)
Gets these warnings (in JSbin):
ContainterName is not defined, missing semi-colon
Are you sure it should be containter rather than container?
Until you find/correct all the errors, it won't matter what browser you use. It won't preview unless everything is correct.
Have you tried running the simpler versions Eric and Inger suggested? Try something simple first to test it out.
<script src="js/01-function.js" /> might change this to:
<script src="js/01-function.js" ></script>
Good overview here (JS in head, JS in body, linking to JS files):
http://www.w3schools.com/js/js_howto.asp
I love deadlines. I like the whooshing sound they make as they fly by. (Douglas Adams)
https://www.callendales.com

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.