/    Sign up×
Community /Pin to ProfileBookmark

I looked, I studied, And….

I’ve gotten nowhere.
I’m using Notepad (Not + or ++).

So, to create a website I can create a folder called “website” on my deskptop. In that folder are three more folders: css (for css code), images (for the website), and js (for JavaScript files).

So far so good?

Everytime I can’t get the JavaScript to work. i use the recommended filename (website/js/numeric-variable.js) but my computer says thats an invalid filename.

to post a comment
JavaScript

6 Comments(s)

Copy linkTweet thisAlerts:
@SempervivumNov 08.2022 — @4539123#1648353
>So, to create a website I can create a folder called "website" on my deskptop. In that folder are three more folders: css (for css code), images (for the website), and js (for JavaScript files).

Yes, that's fine so far.

>Everytime I can't get the JavaScript to work. i use the recommended filename (website/js/numeric-variable.js) but my computer says thats an invalid filename.

It depends on where your html file is located. I suspect it's in the folder "website". If so you have to use

`scr="js/numeric-variable.js"`

when including it.

Edit: You wrote: "images (for the website)". I recommend to reserve this folder for images or pictures and place the html file in"website".
Copy linkTweet thisAlerts:
@NogDogNov 08.2022 — > @4539123#1648353 I'm using Notepad (Not + or ++).

Then you may be at risk of Notepad messing up your code by using "smart quotes" and replacing what should be " or ' characters with directional quotes, as that will break things in every programming language I've ever used, as well as HTML. There may be some way to disable that in Notepad, but I _highly_ recommend you use some editor designed for writing code, not documents.
Copy linkTweet thisAlerts:
@cootheadNov 08.2022 — > @NogDog#1648359

> Then you may be at risk of Notepad messing up your code

> by using "smart quotes" and replacing what should be " or '

> characters with directional quotes, as that will break things

> in every programming language I've ever used, as well as

> HTML


I stopped using [i]Windows 7 Notepad[/i] as it would not save files

with [b]UTF-8[/b] encoding.

I have just done a test with the [i]Windows 10[/i] version and found

that [b]UTF-8[/b] encoding is now supported as standard. I can also

report that there were no problems at all with the [b]quotes[/b]. Of

course, I am presuming that [i]Windows 11[/i] has not adversely

changed it's settings.

[img]https://www.coothead.co.uk/images/testy.gif[/img]

[i]coothead[/i]
Copy linkTweet thisAlerts:
@4539123authorNov 08.2022 — Okay, thanks for the heads up. I'm using Notepad++ now.

Still, I run the following code and it's displayed on my website.
``<i>
</i>&lt;DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Title&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
$(document).ready(function(){
$("calculate").click(function(){
var input = $("#input").val();
var output = $("#output").val();
output = input;
});
});
&lt;/body&gt;
&lt;/html&gt;<i>
</i>
``
Copy linkTweet thisAlerts:
@SempervivumNov 08.2022 — @4539123#1648361

It seems to me that you are just starting to learn HTML and Javascript. If so, I do not recommend to learn jQuery:

https://webentwicklung.ulrichbangert.de/faq/should-i-learn-jquery.html

In the code you posted I spot the following errors:

Exclamation mark missing in doc type, should read `&lt;!DOCTYPE html&gt;</C>

Opening and closing script tags missing. Unfortunately the forum software blocks posting code tags of HTML, both PHP or javascript. You can work around this by omitting the tags or modifying them, e. g. like this for javascript:<br/>
<C>
&lt;_script&gt; javascript code here &lt;_/script&gt;</C><br/>
Or use jsfiddle.net, enter your code over there and post the link.

Please use code tags when posting code: <C>
your code here</C> or triple backticks. I edited your posting accordingly.

When referencing DOM elements by this code:
<CODE>
`<i>
</i>var input = $("#input").val();
var output = $("#output").val();<i>
</i>
``
they have to be defined before.
Copy linkTweet thisAlerts:
@JeffWilliams103Nov 11.2022 — I thought that I was just a bad student, and then it turned out that my teacher was just an unrealistic crammer. And he checks all essays to a single mistake. I turned to the essay writing service https://cheap.essaydoc.com/, because I know that they write them correctly, and without errors. And such an essay rolled!
×

Success!

Help @4539123 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...