locked
How to use java script programming in a website RRS feed

  • Question

  •  Hi

       I am new in this forum. I want to learn how to use java script  in a website.

     

    Thanks.

    Monday, February 8, 2010 3:45 AM

Answers

  • Hi Grants,

    actually there are two main ways to use javascript in a web site:

    1. embed your javascript within the html code using the <script></script> tags

    2. include one or more .js file  containing your javascript code.

    You will want to use the first method for custom specific javascript to use in a given page while the second one is rather for code you want to re-use in different pages: the choice is up to you.

     However, there are so many free tutorials available in the internet, just google "free javascript tutorial" and choose what's the best for your needs.

    Andy

     

    Thursday, February 11, 2010 6:21 AM

All replies

  •  Hi,

    We assume you want to use Silverlight and Javascript. For that go with this and this.

    (Let me know if I misunderstood your problem otherwise mark reply as answer.)

    Monday, February 8, 2010 3:55 AM
  • w3schools.com has great tutorials on javascript and other programming languages and it is free

    Wednesday, February 10, 2010 2:48 PM
  •  I believe you can if you put the javascript into an empty Text field module. It's basically just an empty box that you can put in any coding you want. See if it works after trying that.

    Wednesday, February 10, 2010 4:05 PM
  • Hi Grants,

    actually there are two main ways to use javascript in a web site:

    1. embed your javascript within the html code using the <script></script> tags

    2. include one or more .js file  containing your javascript code.

    You will want to use the first method for custom specific javascript to use in a given page while the second one is rather for code you want to re-use in different pages: the choice is up to you.

     However, there are so many free tutorials available in the internet, just google "free javascript tutorial" and choose what's the best for your needs.

    Andy

     

    Thursday, February 11, 2010 6:21 AM
  •  the best way to go about JavaScript is to either develop your own code or find something similar on the web. Avoid jQuery and similar canned solutions, because they are bloated and slow.

     I wanted to learn jQuery and do some simple <div> fade in/out, so I went and single stepped (with FireBug) until the step 500, where I did quit stepping through. I can tell you that jQuery, up to the step 500 was still just checking the syntax and preparing various objects. The execution of fade in/out did not start at all anywhere before the step 500.

     Than I sat down and wrote my own code, and fade in/out was acted upon from the step 1. Not to mention that my code was 35 Kb, and jQuery was 140 Kb.

     On other side jQuery is so internally complex, because it is multi purpose tool, that you'll never be able to debug anything, not to mention add any missing features you might want.

    jQuery is only good for quick and dirty stuff, when you do not really care. Its actually my first JavaScript attempt here, it is just an online life insurance form, with data validation and fade-in-outs ( 90% finished ;-).

    Thursday, February 11, 2010 9:06 AM
  •  Hi all,

    My name is Asem and I work with java script while encoding my websites. However, I would like to focus a spot of light on a problem that is usually overlooked by many people who are interested in programming with Java scripts.

    Indeed, what is the reason behind buidling a website? It is simply to spread the word about your website and your business as well. In this context, have you ever asked yourself if Google Spiders like websites with Java script. 

    Google Spiders are robots programmed by Google that are responsible to navigate your websites and index them. As a matter of fact, search engine optimization experts do not recommend using Java-Script for websites. 

    Honestly, I have a blog with no Java script and it is now on Google's first page only after few weeks of the publication's date.

    So, when can you use Java-Script?

    In case you do not care about having your website on Google's first page, then use Java-Script. In this case, your already-existing customers will find your site directly by typing the URL in the address bar. 

    Thursday, February 11, 2010 3:29 PM
  • Well eltaher80,

     JavaScript is not going to reduce your SERPS and sometimes one just needs interactivity, like with online forms that need to verify the data.

    Friday, February 12, 2010 7:13 AM
  • Hi again,

    Thanks for the answer. I never meant to leave an impression that Java-Script decreases your SERPS. Indeed, you are right as Java script offers the option to interact with your users.

    But how about using a Blog? It has been seen that free blog-platforms like WORD-PRESS offers an outstanding chance to skip learning java script!

    My idea is just why should beginners devote time and energy in learning Java-Script? As far as I tried, all the features I got from Java Script can be obtained via having a Blog instead of websites.

    Even more, it has been recorded by SEO-Experts that some scripts can not be read that well by Google-Spiders.

     I hope that I cleared it now.

     

    Thanks again and the best of luck to everyone here -:)

     

    Asem

     

    Friday, February 12, 2010 7:28 AM