I am completely stuck

No worries @bon! you are very welcome ! I just realized that I misspelled the last one “it is autoclose-html” and it works great for me! you should try it. I will correct my post :stuck_out_tongue_closed_eyes:

2 Likes

I think you have a misunderstanding about inheritance. After you have inherited from the parent contract in the child contract, you don’t want to use the parent contract anymore. You don’t need to deploy it. You should only interact directly with the parent contract.

The point of inheritance is not to store values in the parent contract. The point is to reuse code, not having to re-write code that is common between multiple child contracts for example. Instead of doing that we can use inheritance to re-use code in all child contracts for example.

If you want to store things in other contracts and interact in between them you should look at external contracts instead. One example would be the Tokensale example in the course. Where we interact between the tokensale contract and the token contract, not using inheritance.

3 Likes

Hi all,

I am stuck on the “Scope - Local and Global Variable” Lecture. In order to connect to the console Ivan has a link in his script: " <script src=“https://ajax.googleapis.com/ajax…”

Where can I find this?

Thanks!

1 Like

To answer your question
Here’s a link to jQuery’s minified code (compressed) which you will need to download, store and reference locally. Alternatively the same code hosted by Google, which you can use with the following snippet within the head tags of your HTML.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

A side note
jQuery provides helpful Javascript methods to interact with HTML elements on the page. Ivan doesn’t actually use any jQuery in this lecture, and you’d be fine to exclude that script from your page at this point. The console and specifically the console.log() is available within any javascript environment. Javascript is always running within your browser, unless you explicitly disable it, so console.log() will always be available and work within your <script> tags. You can view output to the console by opening developer tools, this is found in different locations for each browser, but typically you will be able to find developer tools or web console within the view menu of your browser.

1 Like

Don’t get hung up on the CSS (unless you want to be a website designer… in which case, you might want to check out Free Code Camp). I understand what you mean about wanting to understand everything before moving on, though, because I have that same urge, too, big time! But, like Ivan says, that doesn’t work, because you will never understand everything. Just keep going, even if it feels like you are flying by the seat of your pants. It looks like you are doing well on the HTML. Continue on!

2 Likes

A bit frustrating using console in Chrome!! How do you edit in the console?

1 Like

Hm that is not to connect to the console, the code you included is to get the functionality in the jQuery library. Can you describe what you’re struggling with more?

1 Like

Can you explain your question more, what do you want to edit? Include screenshots of your issue

1 Like

Hi Filip,

Thank you for your guidance.
It seems that I have wrong expectations with inheritance and I think external contracts are best option to consider in this case. Because, I want to store values in one contract and then use those stored values in another contract (by calling the store values function from parent contract to child contract).

I’ll study the tokensale contract and update you about the outcomes.
Thank you again,
with regards,

1 Like

Thank you! This was extremely helpful

1 Like

Seems I was confused - got it straightened out. Thank you

1 Like

I know it’s probably not related to this course but please respond if you have time and the knowledge. I know how while loops work and have learned again in javascript with the book. But my mind is bothering me with this question; How does a programming language embed such a feature to the binary code? Was it there before? I looked for an answer but couldn’t find it. You don’t have to give me an answer, you can just point out the direction for me to look. It’s just I can’t feel comfortable when I am curious about something and don’t understand it :confused:

1 Like

The answer is deeper then code, it involves electronic engineering. You can start at Logic Gates which are the root of all complex operations like loops. From there loops are created by simply combining a mesh of Logic Gates as follows;

55%20am04%20am

Your stepping down a deep rabbit hole my friend, and I don’t feel like spending all day explaining even the basics. But once you get a grasp of Binary Logic Gates, then you look into Ternary, Quinary and Quantum Decision Logic.

5 Likes

Thank you very much, just the information I need it :slight_smile: I just like to understand a little bit background, don’t worry I will not go deeper than that if I will not use it but for making my mind at ease I need it this.

1 Like

Guys I am stuck with my code. The only thing that the code shows once I open it up on google chrome is “This is the title”. Do you see where I went wrong?


Thank you very much guys

1 Like

Hi,
All solved (all by myself!!).
Thank
Cheers Otto

1 Like

At the first glance you should have alert(“a and b are equal”) and then 100 hello worlds.

but in if statement you will never go to else if(false) statement because this statement is always false so javascript will always skip this and go to else

you need to write

if(a > b){
}else if(a < b){
}else{
}

1 Like

Hi thanks for your help. I did the corrections, my page is still blank though… Is there any key mistake that I did or why are there no pop up messages (alerts)?

Fabrice

1 Like

Try with console.log(); Browsers have function if you have a lot of alerts you can click on checkbox prevent to show or something like that. Maybe you checked that.

Your page is completely blank? Not even counter is now text?

1 Like

Maybe check that you haven’t turned notifications off in Chrome because your code works for me.
https://support.google.com/chrome/answer/3220216?co=GENIE.Platform%3DDesktop&hl=en

There is an error in your logic though. The ‘else if (false)’ will always evaluate to false and never run the block of code after it. It will always revert to the final else because there is nothing to evaluate.
You will want to put ‘(a < b)’ in there instead.

Also, semicolons at the end of the alerts is always good practice. :wink:

1 Like