• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

code to switch english to french and french to english

 
Greenhorn
Posts: 10
MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am new to Javascript and have this code to switch english to french and french to english. I have seen other posts on this same coding assignment and have tried to implement the answers from those problems into my code as well as what we went over in the chapter. Everything seems fine when I look at the code but the page isn't working as I intended so I know there is a problem. This is my first javascript assignment and I'm having a very difficult time locating my error. I appreciate any help in advance! I do not just want someone to code this for me, I want to understand where my error is. Here is the javascript code:




 
author & internet detective
Posts: 40798
829
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tesla Doty wrote:Everything seems fine when I look at the code but the page isn't working as I intended so I know there is a problem.


Can you elaborate on what "not working" means? Is there an error in the JavaScript console. Does it do anything?
 
Tesla Doty
Greenhorn
Posts: 10
MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jeanne Boyarsky wrote:

Tesla Doty wrote:Everything seems fine when I look at the code but the page isn't working as I intended so I know there is a problem.


Can you elaborate on what "not working" means? Is there an error in the JavaScript console. Does it do anything?



When I load the page there are English phrases. When you click the phrase it is supposed to show the english phrase, and on mouse up revert back. My apologies for not being as descriptive as I should be. Still getting the hang of wording forum questions right.
 
Sheriff
Posts: 67596
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Open the JavaScript console. Are there any erros when you try to do things?

If not, set breakpoints and see what the code is doing.
 
Ranch Hand
Posts: 15304
6
Mac OS X IntelliJ IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bear Bibeault wrote:Open the JavaScript console. Are there any erros when you try to do things?

If not, set breakpoints and see what the code is doing.



I think you might be assuming too much here, Bear.
 
Tesla Doty
Greenhorn
Posts: 10
MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am doing this for my html class. We have not got into setting breakpoints, debugging, or using the console. We have only just covered tidbits of javascript within web pages in tutorials. I feel like a total noob for not understanding this. The class just throws code at us and doesn't explain much about actually working with the code.
 
author
Posts: 297
5
Android Firefox Browser Fedora
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When I was tasked with writing an introduction to JavaScript in as few pages as possible I started with how to access the developer console, seemed the quickest way to get going.

Tesla, if you're using IE or Chrome: hit F12. If you're using Firefox: hold down Ctrl+Shift and then hit K. Look for where it says 'Console' and select that tab if it's not already selected. Are there any error messages (they'll likely be coloured red or orange)?

For starters, I would investigate this line:


It looks like you're trying to attach a file to the onload event handler. This won't work, the thing on the right of the = needs to be a function. I suspect it's supposed to be:
 
Bear Bibeault
Sheriff
Posts: 67596
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rob Crowther wrote:When I was tasked with writing an introduction to JavaScript in as few pages as possible I started with how to access the developer console, seemed the quickest way to get going.



100% agree.

Learning how to use the console as a tool is one of the very first things to learn. Otherwise, you're flying blind. It's like trying to fight a training droid with the blast shield down -- unless you program using The Force.

 
Rob Crowther
author
Posts: 297
5
Android Firefox Browser Fedora
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can we expect "jQuery Jedi Masters" to follow "Secrets of the JavaScript Ninja"? ;)
 
Bear Bibeault
Sheriff
Posts: 67596
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jedi Master === Ninja in Space!

 
Bear Bibeault
Sheriff
Posts: 67596
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
(Although Secrets of the jQuery Jedi has a certain ring to it, I'm not sure I'd want to pay Lucas-level royalties!)
 
Tesla Doty
Greenhorn
Posts: 10
MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rob Crowther wrote:When I was tasked with writing an introduction to JavaScript in as few pages as possible I started with how to access the developer console, seemed the quickest way to get going.

Tesla, if you're using IE or Chrome: hit F12. If you're using Firefox: hold down Ctrl+Shift and then hit K. Look for where it says 'Console' and select that tab if it's not already selected. Are there any error messages (they'll likely be coloured red or orange)?

For starters, I would investigate this line:


It looks like you're trying to attach a file to the onload event handler. This won't work, the thing on the right of the = needs to be a function. I suspect it's supposed to be:



Thank you so much for your help! Now I'll be able to figure out where my problems are. I can't believe they didn't tell us about that in class.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic