JavaScript - Uses Of Javascript Within And Outside Of Web Pages?
Hi, I'm in year 11 studying GCSE Computing and I'm working on gathering some primary research for a project. I'd be really grateful if someone with experience in web developing would be able to explain to me some of the uses of JavaScript within web pages- what have you used it for specifically?
Also, any examples of how JavaScript is used outside of web pages would be really helpful. Thank you! Similar TutorialsHi, I want to redirect pages e,g 'http://mydomain.com/pagename.html' to 'http://www.mydomain.com/pagename.html",i.e if anyone access without www then it will be added automatically,how can i do this using javascript? plz help Thanks I'm trying to allow the user to change the stylesheet of my website. I can change the stylesheet on a page by page basis (eg. from red style to blue style) but once the user navigates to a different page the stylesheet resets back to the original setting. For example, when the user visits the site first its set to the red style, they can change it to blue but when they navigate to another page the style goes back to red again where as I want the style to stick across pages. Does anybody know how I can sort this out? I assume I'll have to edit my javascript but Im not very good at javascript so any help would be great! HTML Code: <html> <head> <link href="red.css" rel="stylesheet" type="text/css" title="red" media="screen" /> <link href="green.css" rel="alternate stylesheet" type="text/css" title="green" media="screen" /> <link href="blue.css" rel="alternate stylesheet" type="text/css" title="blue" media="screen" /> <script type="text/javascript"> function changeStyle(title) { var lnks = document.getElementsByTagName('link'); for (var i = lnks.length - 1; i >= 0; i--) { if (lnks[i].getAttribute('rel').indexOf('style')> -1 && lnks[i].getAttribute('title')) { lnks[i].disabled = true; if (lnks[i].getAttribute('title') == title) lnks[i].disabled = false; }}} </script> </head> <body> <a href = "home1.html">Page 1</a> <br> <br> <a href = "home2.html">Page 2</a> <br> <br> <a href = "home3.html">Page 3</a> <br> <br> <br> <br> <a href = "#" onclick="changeStyle('red')">Red Stylesheet</a> <br> <br> <a href = "#" onclick="changeStyle('blue')">Blue Stylesheet</a> <br> <br> <a href = "#" onclick="changeStyle('green')">Green Stylesheet</a> </body> </html> CSS Code: body { background-color:red; } Hi, Im using a authoring tool to develop an elearning test course. The course is composed of several HTML pages with Buttons for the multiple choice test. The setup of the course is that it will only ask 10 questions out of a pool of 30 questions. When the HTML & JS files are online, the test takes 20-40seconds to load. I believe it is related to the code that selects the 10 questions from the 30. I've singled out the code that does the select random pages... Is there any way to optimize the code? I've attached the HTML (in txt format) page where the javascript can be found. Looking forward to your replies! Ok Need Help Here. As I post earlier how to detect firefox before let the user in some guys just disable javascript and went in I finding solution i think of it but i dun know the code not sure is it working Script that allow the browser to check weather javascript is ON if not cannot grant access to the page . Another thing is by using a image means when i enter the site it will show a image i will need to click it before it enter the content of the pages i think that a javascript code i seen it somewhere else about months ago. Hi, I coded the following JavaScript: Code: var el = document.createElement("iframe"); el.setAttribute('id', 'ifrm'); document.body.appendChild(el); el.setAttribute('height', 250); el.setAttribute('width', 300); el.setAttribute('frameborder', 0); el.setAttribute('marginheight', 0); el.setAttribute('marginwidth', 0) el.setAttribute('src', 'http://example.com/?pub=1&format=image&size=300x250&url='+window.location); And am putting it between <script type="text/javascript"> and </script> tags in the <body> section of my site. But, it only works in certain areas of the page. Can you guys think of any reason for this? Let me know... Thanks, ~Christian how do i make something like this? so that instead of viewing a long list it will be divided into pages..? How would you connect a HTML page wig a JavaScript page so a person could not reed JavaScript but it would still work.
Hi Forum, to develop a "Digital Signage" applikation we need: 1) After loading the (main) html page get all the pages (.html, .pdf, .xls, .jpg) as members of the paylist. - Is there a way to get the appr. 15 pages into the browser (as DOM Objects) ? Or rather to load in 15 iFrames ? 2) The mentionde pages should be displayed in a certain order (in ca. 20 sec tact). - A possible solution would be to hide / unhide. Any other wy ? Thanks in advance Michel Hi, I know lot of scripts written by experts in JS that extracts urls from source code placed into DIV or TEXTAREA, but I would need just one to extract the links ending by ".html" or ".htm" or ".txt". I would appreciate any helpful. Just he! Hi all, I'd like to insert an image with fixed position in all https pages. Is it possible? How? Thank you very much Hello! I was wondering if it is possible with Javascript to keep the values of certain variables in memory, even if another page has been loaded. My aim is to gather information from a few pages and, when come to the last page, submit them all together to the perl script. My first page looks like: Code: <form name="step1" method="post" action="/cgi-sys/formmail.pl"> <input type="hidden" name="recipient" value="pavlos.thes@gmail.com"/> <input type="hidden" name="subject" value="Poll Results"/> <input name="radiobutton" type="radio" value="Grill"> Grill <input name="radiobutton" type="radio" value="Club"> Club Sandwich <input name="radiobutton" type="radio" value="Crepes"> Crepes <input name="radiobutton" type="radio" value="Toast"> Toast <input name="radiobutton" type="radio" value="Hotdog"> Hot Dog <input name="radiobutton" type="radio" value="Special"> Special Products <input name="radiobutton" type="radio" value="Salads"> Salads <p> <input type="button" name="Submit" value="Next Question >" onclick="javascript:location.href='Poll_Jan2010_02.html'"> </form> And the next ones look pretty much the same, only the name of the form changes (step2, step3, step4 etc), and the url of the location.href in the end (Poll_Jan2010_03.html, Poll_Jan2010_04.html, etc) and of course in the next pages i might use checkboxes or textfields instead of radiobuttons. Could someone help me out doing this? Good day Lets say I have a page with 3 thumbnails and one big div. When click in one of the thumbnails the image of it must appear inside the big div. Of course there are 3 images (little ones for the thumbnails) and 3 big images for the real size ones. Script this is simple for me but imposible if I have more than 100 pages within 6 images inside them (3 little and 3 real size for 3 thumnail divs and one single big div). There must be some kind of order to just script the divs of the thumbnail divs and the real size image div in all the pages at ones, otherwise I have to creat ID's to every single div inside every single page! (4 id's to one page and I have more than 100 pages!, this is inpractical because is posible that in the future the pics change, is more than 400 id's) For example: for FIRST.html big div (div id="img001bg") thumb1 div (div id="th_img001" thumb2 div (div id="th_img002" thumb3 div (div id="th_img003" SECOND.html THIRD.html ... HUNDRED.html ... ! There must be some solution using somehow the functions, please help! Thank you to all m using Jquery - isotope from http://isotope.metafizzy.co/ i noticed that the linking to a specific category is not possible since it filters using “data-filter” The links a PHP Code: <a href="#" data-filter="*" >all</a> <a href="#" data-filter=".logo" >logo</a> <a href="#" data-filter=".design" >design</a> i tried using linking like this below but it didn't work: PHP Code: <a href="portfolio.html#filter=logo" data-filter=".logo">logo</a> can anyone see if there’s a possibility to link to the “design” or "logo" category from another page? so that it would be already filtered when the user reaches the page. hi, im new to the html and javascript stuff and am coding my own site, and currently stuck. hope someone can help! for my website layout, i want to have 4-5 buttons on the left side for the different links, and on the right half i want to load that link without reloading the entire webpage. currently i have it so that everything is in tables, so table's left column contains the links (for example - Link1, Link2, Link3, Link4, Link5). now when i were to click any of those i want the page corresponding to that link to open up in the right column without reloading the entire page. i'm stuck on how to pass what i click on the left to load up on the right. any help would be nice! thanks 1. Go to drugstore.com 2. click on "international link" at the right hand top corner 3. An over lay appears where you can select country and currency drop down is auto filled. 4. Click on Update country & currency button updates the site for that country and 5. Click on Proceed as US customer updates site for US customer. 1. Go to drugstore.com 2. Click on any tab like hair care and add a product to bag 3. Click on international link at the right hand top corner 4. An over lay appears where you can select country and currency drop down is auto filled. 5. Click on Update country & currency button does not update the country on the website. Any help is very much appreciated. Thanks in advance!! Hi All, I am trying to create a website and am having problems editing a piece of code. A working example can be seen Here The only problem is that the "pages" are open when a user arrives on the site and I want them to be " closed" until a user clicks them, much like the "Search, Profile & Draw" tabs. I have included all the coding used to this, the only thing I haven't included are the images. Anyone got any idea how this is possible? Regards Jake I have the following snippet of HTML code: Quote: <table id="identificativo"> .......... .......... .......... <tr id="id_riga"> <td width="40%"> Cella 1 </td> <td> <input type="hidden" name="params" value="valore1 valore2" /> <input type="button" value="Add/Change" onclick="return del()" /> </td> <td> Cella3 </td> </tr> ............ ............ ............ and the following javascript code that replace the second row of table with new form: Quote: function del() { if (document.getElementById) { var tabella = document.getElementById("identificativo"); tabella.deleteRow(1); x = tabella.insertRow(1); x.innerHTML = "<td colspan='3'> \ <form action='/cgi-bin/save.cgi' method='POST'> \ <input type='text' name='name' size='30' /> \ <input type='submit' value='Save' /> \ </form> \ </td>"; } } How can to pass hidden values valore1 and valore2 from old cell of row to new form with javascript? Thank you in advance to answers, savio |