Ok, This is just annoying me now, i need to

Create a webpage with embedded JavaScript code that loads one of two files depending on whether the user presses the A key or the B key on the keyboard without refreshing the page. Is it necessary to use the XMLHttpRequest object for this task?

I not sure what to do? Not asking somebody to do it for me, just asking if somebody can point me in the right direction, I have no code, Yet....

Any help is greatly appreciated!

Correct, this situation would require an XHR if using traditional javascript and html. Essentially you'll want to place place a function in the onKeyUp of your page body, check which key was pressed, and then perform a request accordingly. You'll then want to do a document.write() or render the response of the XHR to a div tag. Here's a good resource for doing these: http://www.w3schools.com/ajax/default.asp. This site has tons of info for any web development stuff.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.