-
Personal Portfolio Site
Smashing Magazine has a lot of these, for example: "50 Beautiful And Creative Portfolio Designs"
-
Submit form without reloading page (AJAX)
Maybe they like to use it, maybe they don't know how to use anything else, or maybe they just don't know how to do it any other way. Personally, I used it in this example to keep things simple and to make things as clear as possible. In this case the page would reload and the value in the form would be put in the url as GET values.
-
Submit form without reloading page (AJAX)
[sOLVED] Hello! I'm experimenting a little with ajax, and have run into a problem. How can I make a HTML form that let's me use the onsubmit event without reloading the page? Example: <form name="userInput" onsubmit="send()"> <input type="text" name="input1" /> <input type="submit" value="send" /> </form> send() is a javascript function that uses ajax to send the values in the input1 field to the server and get the result back. My only problem is that the page refreshes when i submit the form, how can I make this not happen? Alternatively, is there another way to execute the send() function when the user presses a submit button or enter on his keyboard? EDIT: I figured out how to do it. If the javascript executed by the onsubmit event returns false, the page form will not be sent and the page will not be reloaded. So, if the send() function returns false, the page wont reload. You can also add "return false;" after the send() function like this: Example: <form name="userInput" onsubmit="send();return false;"> <input type="text" name="input1" /> <input type="submit" value="send" /> </form> oh, protip: do not name the function in the onsubmit event "submit()", I did that and it screwed stuff up somehow.
-
Help With Table And Image Change
Agreed, I think you might have over complicated the site.
-
Saving variables in Javascript
Hi! To begin with explaining my problem, I'l just show you some code: function moveLeft(id) { e = document.getElementById(id).style.right; if (e.runOnce || 1) { e.variable1=1; e.variable2=1; e.variable3=1; e.runOnce=1; } (some code that requires the saved variables next time this function is run) } As you see, I saved some variables inside an element in this code. This is useful sometimes, but can I save variables in a similar way, in other things than HTML elements? Like, creating an object in Javascript or something. It's not allways wery handy to create a new HTML element each time I want a place to save variables. PS: I am pretty new to HTML and Javascript, so please excuse me if I've got some words or names wrong here
- Count to 1 million