September 25, 20169 yr Good morning I am Anna. I am an artist and have a website with my drawings and would like to make a button that can randomly open a new page after it is pressed. As an example: www.boredbutton.com I tried to see the website source to find out the code that randomly chooses the pages but all I could find is the form html: <form name="bored" method="post" action="/random" class="button"> <input type="image" name="submit" src="/i/boredButton.png" value="Bored No More" /> <input type="hidden" value="submit" name="ie7sucks"> </form> If you know what is the rest script code I need to add to my root directory where I can add the random pages I would be very thankful for your help.
September 25, 20169 yr Something simple which could help you - http://codepen.io/span/pen/WGpLdR . Full view - http://codepen.io/span/full/WGpLdR
September 28, 20169 yr Author It is just what I needed what should I put in my root directory? I will add the html code of my pages: <button id="button" class="btn">Button</button> And what should I create for CSS and JS codes? Where to put them? In the web.confiig file?
September 28, 20169 yr I don't know your website/code and also it's not a good idea just to say put this here, put this there. But, usually, there are one or more .css files (for example main.css, css.css, style.css or similar) and .js files (for example js.js or similar) where you can put your css/javascript code. And also, change the id as it's very common, for example <button id="random-url-button" class="btn">Button</button> and change it in the javascript code too.
Create an account or sign in to comment