JavaScript - Anyone With Xhr Experience Able To Help?
We're trying to interact with an API but struggling with XHR and how to send data/get response.
If you're able to help with a few small projects please get in touch with your typical hourly rate. Thanks! Similar TutorialsContact me via skype: jaygorman1
Ok, so I decided to make an Experience Generator for my site. I started simple by making one that uses a prompt. First it prompts for your level, then it multiplies it by using a random number function. This code below. Code: <html> <head> <title>Experience Generator</title> <script type="text/javascript"> var A= Math.round(Math.random()*100); var B= prompt('Place your Level Here'); function Expearned() { document.write(Exp=B*A); document.write(" Experience Points Earned"); } </script> </head> <body> <a href="javascript:Expearned()">Experience Calculator</a><br /> </body> </html> Then, I thought... I don't like using prompts. So, how about using text inputs and buttons instead. I then created this code. Code: <html> <head> <title>Experience Generator</title> <script type="text/javascript"> var A= Math.round(Math.random()*100); var B= input(); function Expearned() { document.write(Exp=B*A); document.write(" Experience Points Earned"); } </script> </head> <body> <FORM ACTION="#" NAME=LeveltoExp></FORM> Enter Level <INPUT TYPE=TEXT NAME="Enter Level" SIZE=3> <BR><BR> <INPUT TYPE=BUTTON VALUE="Earn Experience" ONCLICK=" Expearned() + 'is ' + ' Experienced Earned'"> <BR><BR> </FORM> </body> </html> BUT this code pulls up and error at the line of var B.. What I am trying to do is pass the form to the var B and then goes on from there to do the Experience Generator. Can anyone Help me???? Hi, Right I have a bit of a beginners problem, I am a designer and previously had a little HTML knowledge, I am working for a charity and have picked up their website, http://www.2learn.org.uk They had a drop down menu in place, which I would now like to change. I want to learn how to edit items within the code, delete add and change. I have tried to understand and manipulate the code but as I have not worked with javascript except copying sample code or basic stuff in BlueJ years ago that I forget. What do I need to do in order to get this sorted can anyone help, sorry if this is a bit vague but I'm not sure where to start. I could liase with someone with the code, call it pro boner work for yourselves. Thanks Tom |