Website Toolbox Pro

Changing Background Image By Javascript

Backgrounds, Design, Javascript Comments »
I have a link in HTML page with background image coming from CSS class. How can I change that background image by javascript?

document.getElementById('lnkSubmit').style.backgroundImage is not working.

Continue reading Changing Background Image By Javascript »

How Can I Send “Ctrl” Key With JavaScript Without Any Click On Keyboard?

Javascript Comments »
Well, not sure what you are trying to do but you can create an event object and set its ctrlKey property to true.

var evt = document.createEventObject();
evt.ctrlKey = true;

You can then pass around the event object and set its keycode to something.

Best Ways To Learn HTML And Javascript?

Javascript, PHP / MySQL Comments »
I’m looking to make my own website in the next year or so… I am familiar with the basics of html, but I need this new site to be able to incorporate data from a database. I’ve been told the best thing for that is javascript… I just need to know how to teach myself the code.

You’ve been told a wrong information. Javascript can’t help to build a website that is able to incorporate data from a database.

PHP language and MySQL databases are what you are looking for. PHP is a server-side language, that is one whose code is meant to run on the server which holds the page content as well as the database. In the opposite, Javascript is a client-side language, which is run on the computer of the user viewing the content.

Good places to start learning PHP are w3schools.com and PHP Basics Tutorials on LearnPHP.org.

Also, you may be interested in this book:
Build Your Own Database Driven Website Using PHP & MySQL

Sorting One Array Based On Another One In Javascript?

Javascript Comments »
I have two arrays. 1 array is an array of distances from a certain point. I know that if I want to sort this by shortest to farthest distance, that is easily done with an array sort. However, my other array is an array of city names that correspond with the distances in the first array. How could I sort the city array such that it would be identical to the distance array order after a numerical sort? Would it be easier to put them both into one array and some how specify to sort only the distance set? I wouldn’t know how to do that. Thanks!

I should have been a little more clear. I was trying to use the array.sort() function rather than writing a sort from scratch

Continue reading Sorting One Array Based On Another One In Javascript? »

Were I Can Learn Javascript?

Javascript Comments »
I have a book on it but it really doesn’t help. I generally tend to lose my focus when the book is 359 pages long. I just want a site or free download program that can enable me to learn javascript. I am a complete beginer and have no experience in java but know basic html.

w3schools.com – you can also learn php, html etc. Highly recomended.

Also javascript.internet.com for loads of tips.

Website Toolbox Pro has a built-in Javascript library.